Refactor authentication flow
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
All checks were successful
FarmMaps.Develop/FarmMapsLib/pipeline/head This commit looks good
This commit is contained in:
@@ -1,12 +1,19 @@
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'fm-auth-callback',
|
||||
template:'<div></div>'
|
||||
})
|
||||
export class AuthCallbackComponent {
|
||||
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
import { Component } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { OAuthService } from 'angular-oauth2-oidc';
|
||||
import { Location} from '@angular/common';
|
||||
|
||||
@Component({
|
||||
selector: 'fm-auth-callback',
|
||||
template:'<div></div>'
|
||||
})
|
||||
export class AuthCallbackComponent {
|
||||
|
||||
constructor(private router$: Router,private oauthService$:OAuthService) {
|
||||
oauthService$.loadDiscoveryDocument().then(() => {
|
||||
oauthService$.tryLoginCodeFlow().then(() => {
|
||||
router$.navigateByUrl((oauthService$.state && oauthService$.state!="")?decodeURIComponent(oauthService$.state):"");
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user