bugfix: restablecido el login
This commit is contained in:
@@ -14,18 +14,23 @@ export class HeaderComponent implements OnInit {
|
||||
|
||||
async login(): Promise<void> {
|
||||
this.oauthService.configure(authConfig);
|
||||
await this.oauthService.loadDiscoveryDocumentAndTryLogin().then((_) => {
|
||||
console.log(
|
||||
'LOGGED=' + (this.oauthService.hasValidIdToken()
|
||||
&& this.oauthService.hasValidAccessToken())
|
||||
);
|
||||
});
|
||||
await this.oauthService.loadDiscoveryDocument();
|
||||
if (
|
||||
!this.oauthService.hasValidIdToken() ||
|
||||
!this.oauthService.hasValidAccessToken()
|
||||
) {
|
||||
this.oauthService.initLoginFlow('some-state');
|
||||
}
|
||||
}
|
||||
|
||||
logout(): void {
|
||||
this.oauthService.revokeTokenAndLogout();
|
||||
}
|
||||
|
||||
get logged(): boolean {
|
||||
return this.oauthService.getIdentityClaims() != null;
|
||||
}
|
||||
|
||||
get name(): any {
|
||||
const claims = this.oauthService.getIdentityClaims();
|
||||
if (!claims) {
|
||||
|
||||
Reference in New Issue
Block a user