From ea3af9878e76f7d3410716a76b2af21f564d27c8 Mon Sep 17 00:00:00 2001 From: Mirko Mollik Date: Sat, 4 May 2024 22:51:22 +0200 Subject: [PATCH] fix: logout of pwa Signed-off-by: Mirko Mollik --- apps/holder/projects/pwa/src/app/auth/auth.service.ts | 2 +- apps/holder/projects/pwa/src/app/authConfig.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/holder/projects/pwa/src/app/auth/auth.service.ts b/apps/holder/projects/pwa/src/app/auth/auth.service.ts index acac671a..5ee63f8b 100644 --- a/apps/holder/projects/pwa/src/app/auth/auth.service.ts +++ b/apps/holder/projects/pwa/src/app/auth/auth.service.ts @@ -189,7 +189,6 @@ export class AuthService implements AuthServiceInterface { public async logout() { this.oauthService.logOut(); - this.router.navigateByUrl('/login'); } public refresh() { this.oauthService.silentRefresh(); @@ -213,6 +212,7 @@ export class AuthService implements AuthServiceInterface { return this.oauthService.getIdToken(); } public get logoutUrl() { + alert(this.oauthService.logoutUrl); return this.oauthService.logoutUrl; } } diff --git a/apps/holder/projects/pwa/src/app/authConfig.ts b/apps/holder/projects/pwa/src/app/authConfig.ts index cc778254..fe316277 100644 --- a/apps/holder/projects/pwa/src/app/authConfig.ts +++ b/apps/holder/projects/pwa/src/app/authConfig.ts @@ -15,4 +15,5 @@ export const authConfig: AuthConfig = { showDebugInformation: false, // Also requires enabling "Verbose" level in devtools clearHashAfterLogin: false, // https://github.com/manfredsteyer/angular-oauth2-oidc/issues/457#issuecomment-431807040, nonceStateSeparator: 'semicolon', // Real semicolon gets mangled by Duende ID Server's URI encoding + logoutUrl: `${environment.keycloakHost}/realms/${environment.keycloakRealm}/protocol/openid-connect/logout`, };