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