Merge remote-tracking branch 'refs/remotes/origin/main'
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m30s

This commit is contained in:
2026-03-12 10:31:46 +01:00
8 changed files with 326 additions and 28 deletions

View File

@@ -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">

View File

@@ -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);
}, []);

View File

@@ -21,6 +21,7 @@ ReactDOM.createRoot(document.getElementById('root')).render(
<App />
<Toaster
position="top-right"
containerStyle={{ top: 70 }}
toastOptions={{
duration: 4000,
style: {