feat(auth): enhance logout process to support RP-Initiated Logout for OIDC users
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m35s

This commit is contained in:
2026-03-10 22:19:01 +01:00
parent a7b0b84f2d
commit 3ab7ab6a70
4 changed files with 44 additions and 3 deletions

View File

@@ -42,7 +42,13 @@ export function AuthProvider({ children }) {
const logout = useCallback(async () => {
try {
await api.post('/auth/logout');
const res = await api.post('/auth/logout');
localStorage.removeItem('token');
setUser(null);
if (res.data?.keycloakLogoutUrl) {
window.location.href = res.data.keycloakLogoutUrl;
return;
}
} catch {
// ignore — token is removed locally regardless
}