Trabajo integrando angular-oauth2-oidc
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user