import { Component } from '@angular/core'; import { Router } from '@angular/router'; import { OAuthService } from 'angular-oauth2-oidc'; @Component({ selector: 'fm-auth-callback', template:'
' }) export class AuthCallbackComponent { constructor(private router$: Router,private oauthService$:OAuthService) { this.oauthService$.loadDiscoveryDocument().then(() => { this.oauthService$.tryLoginCodeFlow().then(() => { this.router$.navigateByUrl((this.oauthService$.state && this.oauthService$.state!="")?decodeURIComponent(this.oauthService$.state):""); }).catch(() => { this.router$.navigateByUrl("/"); }); }) } }