From 9f32e76a99b019f34c57b174b15ecc14020bcb16 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 18 Apr 2017 11:31:43 -0400 Subject: [PATCH] clear vault rootScope when visiting org admin --- src/app/config.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/config.js b/src/app/config.js index 7b70adba44..f6d6e0779e 100644 --- a/src/app/config.js +++ b/src/app/config.js @@ -24,7 +24,7 @@ angular if (!token) { return; } - + if (!tokenService.tokenNeedsRefresh(token)) { return token; } @@ -269,6 +269,9 @@ angular // user is guaranteed to be authenticated becuase of previous check if (toState.name.indexOf('backend.org.') > -1 && toParams.orgId) { + // clear vault rootScope when visiting org admin section + $rootScope.vaultLogins = $rootScope.vaultFolders = null; + authService.getUserProfile().then(function (profile) { var orgs = profile.organizations; if (!orgs || !(toParams.orgId in orgs) || orgs[toParams.orgId].status !== 2 ||