Merge remote-tracking branch 'refs/remotes/origin/main'
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m30s
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m30s
This commit is contained in:
@@ -116,7 +116,7 @@ export default function Sidebar({ open, onClose }) {
|
||||
className="w-full h-full object-cover"
|
||||
/>
|
||||
) : (
|
||||
(user?.display_name || user?.name)?.[0]?.toUpperCase() || '?'
|
||||
(user?.display_name || user?.name)?.split(' ').map(n => n[0]).join('').toUpperCase().slice(0, 2) || '?'
|
||||
)}
|
||||
</div>
|
||||
<div className="min-w-0">
|
||||
|
||||
@@ -41,12 +41,20 @@ export function AuthProvider({ children }) {
|
||||
}, []);
|
||||
|
||||
const logout = useCallback(async () => {
|
||||
let keycloakLogoutUrl = null;
|
||||
try {
|
||||
await api.post('/auth/logout');
|
||||
const res = await api.post('/auth/logout');
|
||||
keycloakLogoutUrl = res.data?.keycloakLogoutUrl || null;
|
||||
} catch {
|
||||
// ignore — token is removed locally regardless
|
||||
}
|
||||
localStorage.removeItem('token');
|
||||
if (keycloakLogoutUrl) {
|
||||
// Redirect to Keycloak BEFORE clearing React state to avoid
|
||||
// flash-rendering the login page while the redirect is pending.
|
||||
window.location.href = keycloakLogoutUrl;
|
||||
return;
|
||||
}
|
||||
setUser(null);
|
||||
}, []);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ ReactDOM.createRoot(document.getElementById('root')).render(
|
||||
<App />
|
||||
<Toaster
|
||||
position="top-right"
|
||||
containerStyle={{ top: 70 }}
|
||||
toastOptions={{
|
||||
duration: 4000,
|
||||
style: {
|
||||
|
||||
Reference in New Issue
Block a user