diff --git a/frontend/js/auth.js b/frontend/js/auth.js index b0f04da..ba08c06 100644 --- a/frontend/js/auth.js +++ b/frontend/js/auth.js @@ -294,6 +294,19 @@ function initLoginForm() { try { await AuthManager.login(username, password, rememberMe); AuthManager.showApp(); + + // Re-sync language from server now that we're authenticated + try { + const resp = await fetch('/api/auth/me', { credentials: 'include' }); + if (resp.ok) { + const user = await resp.json(); + if (user.language && user.language !== getLocale()) { + const { setLocale } = await import('./i18n.js'); + await setLocale(user.language); + } + } + } catch (e) { /* non-bloquant */ } + // Load app data after successful login try { await Promise.all([loadVaults(), loadTags()]);