Correcciones ejemplo
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { authConfig } from './auth.config';
|
||||
import { Component } from '@angular/core';
|
||||
import { OAuthService, NullValidationHandler } from 'angular-oauth2-oidc';
|
||||
import { OAuthService } from 'angular-oauth2-oidc';
|
||||
import { Router } from '@angular/router';
|
||||
import { filter } from 'rxjs/operators';
|
||||
import { authCodeFlowConfig } from './auth-code-flow.config';
|
||||
@@ -19,14 +18,15 @@ export class AppComponent {
|
||||
this.oauthService.events
|
||||
.pipe(filter((e) => e.type === 'token_received'))
|
||||
.subscribe((_) => {
|
||||
console.debug('state', this.oauthService.state);
|
||||
console.log('state', this.oauthService.state);
|
||||
this.oauthService.loadUserProfile();
|
||||
});
|
||||
}
|
||||
|
||||
private configureCodeFlow() {
|
||||
private configureCodeFlow(): void {
|
||||
this.oauthService.configure(authCodeFlowConfig);
|
||||
this.oauthService.loadDiscoveryDocumentAndTryLogin().then((_) => {
|
||||
this.oauthService.loadDiscoveryDocumentAndTryLogin().then((success) => {
|
||||
console.error('LOGIN success=' + success);
|
||||
if (useHash) {
|
||||
this.router.navigate(['/']);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user