1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-09-19 02:51:14 +02:00

clear vault rootScope when visiting org admin

This commit is contained in:
Kyle Spearrin 2017-04-18 11:31:43 -04:00
parent e89e48014c
commit 9f32e76a99

View File

@ -24,7 +24,7 @@ angular
if (!token) { if (!token) {
return; return;
} }
if (!tokenService.tokenNeedsRefresh(token)) { if (!tokenService.tokenNeedsRefresh(token)) {
return token; return token;
} }
@ -269,6 +269,9 @@ angular
// user is guaranteed to be authenticated becuase of previous check // user is guaranteed to be authenticated becuase of previous check
if (toState.name.indexOf('backend.org.') > -1 && toParams.orgId) { 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) { authService.getUserProfile().then(function (profile) {
var orgs = profile.organizations; var orgs = profile.organizations;
if (!orgs || !(toParams.orgId in orgs) || orgs[toParams.orgId].status !== 2 || if (!orgs || !(toParams.orgId in orgs) || orgs[toParams.orgId].status !== 2 ||