mirror of https://github.com/abpframework/abp.git
3 changed files with 21 additions and 0 deletions
@ -0,0 +1,17 @@ |
|||
import { Injectable } from '@angular/core'; |
|||
import { CanActivate } from '@angular/router'; |
|||
import { OAuthService } from 'angular-oauth2-oidc'; |
|||
|
|||
@Injectable() |
|||
export class AuthenticationFlowGuard implements CanActivate { |
|||
constructor(private oauthService: OAuthService) {} |
|||
|
|||
canActivate() { |
|||
if (this.oauthService.responseType === 'code') { |
|||
this.oauthService.initCodeFlow(); |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
} |
|||
Loading…
Reference in new issue