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
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m35s
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user