More migration fixes
This commit is contained in:
@@ -38,24 +38,19 @@ export class AuthGuard implements CanActivate, CanLoad, CanActivateChild {
|
||||
|
||||
checkLogin(url: string): boolean {
|
||||
if (!this.oauthService.hasValidAccessToken()) {
|
||||
this.oauthService.responseType
|
||||
if(this.oauthService.responseType == "code")
|
||||
if(this.oauthService.getRefreshToken() != null ) {
|
||||
this.oauthService.refreshToken().then(() => {
|
||||
this.store.dispatch(new appCommonActions.InitUser());
|
||||
return true;
|
||||
}).catch(() => {
|
||||
this.oauthService.initCodeFlow(url);
|
||||
return false;
|
||||
}
|
||||
)
|
||||
} else {
|
||||
if(this.oauthService.getRefreshToken() != null ) {
|
||||
this.oauthService.refreshToken().then(() => {
|
||||
this.store.dispatch(new appCommonActions.InitUser());
|
||||
return true;
|
||||
}).catch(() => {
|
||||
this.oauthService.initCodeFlow(url);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
this.oauthService.initImplicitFlow(url);
|
||||
}
|
||||
)
|
||||
} else {
|
||||
this.oauthService.initCodeFlow(url);
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this.store.dispatch(new appCommonActions.InitUser());
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user