Trabajo integrando angular-oauth2-oidc

This commit is contained in:
2021-03-16 18:04:46 +01:00
parent fb4ebbb1f8
commit 7355f1ae7b
4 changed files with 80 additions and 54 deletions

View File

@@ -1,7 +1,6 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { AuthService, AuthState } from './services/auth.service';
import { OidcSecurityService } from 'angular-auth-oidc-client';
@Component({
selector: 'app-root',
@@ -13,22 +12,20 @@ export class AppComponent implements OnInit, OnDestroy {
constructor(
private route: ActivatedRoute,
private oidcSecurityService: OidcSecurityService,
// private authService: AuthService,
private authService: AuthService,
private router: Router
) { }
async ngOnInit(): Promise<void> {
console.log('AppComponent.ngInit()');
this.oidcSecurityService.checkAuth().subscribe((auth) => console.log('is authenticated', auth));
// const chatLoginToken = await this.waitChatToken();
// const authState = await this.authService.configureAndTryLogin(chatLoginToken);
const authState = await this.authService.configureAndTryLogin(null);
// if (authState !== AuthState.ChatLoggingInProcess) {
if (authState !== AuthState.ChatLoggingInProcess) {
this.showOverlay = false;
// }
}
}
ngOnDestroy(): void {