This commit is contained in:
Eneko Nieto
2021-01-22 19:20:06 +01:00
parent 6bb528e5fc
commit 6338e3fef9
7 changed files with 15 additions and 48 deletions

View File

@@ -14,10 +14,12 @@ export class HeaderComponent implements OnInit {
async login(): Promise<void> {
this.oauthService.configure(authConfig);
await this.oauthService.loadDiscoveryDocument();
sessionStorage.setItem('flow', 'code');
this.oauthService.initLoginFlow();
await this.oauthService.loadDiscoveryDocumentAndTryLogin().then((_) => {
console.log(
'LOGGED=' + (this.oauthService.hasValidIdToken()
&& this.oauthService.hasValidAccessToken())
);
});
}
logout(): void {