diff --git a/ui/src/auth/auth-store.ts b/ui/src/auth/auth-store.ts index 7cf318e7..a01adec7 100644 --- a/ui/src/auth/auth-store.ts +++ b/ui/src/auth/auth-store.ts @@ -154,15 +154,17 @@ export const useAuthStore = create((set, get) => ({ isAuthenticated: false, error: null, }); + const loginUrl = `${config.basePath}login?local`; if (endSessionEndpoint && idToken) { - const postLogoutRedirect = `${window.location.origin}${config.basePath}login?local`; const params = new URLSearchParams({ id_token_hint: idToken, - post_logout_redirect_uri: postLogoutRedirect, + post_logout_redirect_uri: `${window.location.origin}${config.basePath}login?local`, + }); + fetch(`${endSessionEndpoint}?${params}`, { mode: 'no-cors' }).finally(() => { + window.location.href = loginUrl; }); - window.location.href = `${endSessionEndpoint}?${params}`; } else { - window.location.href = `${config.basePath}login?local`; + window.location.href = loginUrl; } }, }));