Skip to content

Commit 80408d0

Browse files
committed
Fix validate token for multi user
1 parent facd9e8 commit 80408d0

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/angular2-token.service.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,15 +397,16 @@ export class Angular2TokenService implements CanActivate {
397397

398398
// Try to load user config from storage
399399
private _tryLoadAuthData() {
400+
400401
let userType = this._getUserTypeByName(localStorage.getItem('userType'));
402+
if (userType)
403+
this._currentUserType = userType;
404+
401405
this._getAuthDataFromStorage();
402406
this._getAuthDataFromParams();
403407

404408
if (this._currentAuthData != null)
405409
this.validateToken();
406-
407-
if (userType != null)
408-
this._currentUserType = userType;
409410
}
410411

411412
// Match user config by user config name

0 commit comments

Comments
 (0)