fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist
This commit is contained in:
1 parent
1aed64b4ef
commit
9771d997f4
7 files changed
+29
-5
No files matched your search
@@ -15,6 +15,9 @@ export default function SignOutButton({ className = '' }: { className?: string }
|
||||
setBusy(true)
|
||||
try {
|
||||
await signOut()
|
||||
} catch {
|
||||
// The local session is cleared either way; the server may not have revoked the others.
|
||||
window.alert(t('shell.sign_out_failed'))
|
||||
} finally {
|
||||
// The guard would redirect anyway; going home keeps the local tool one step away.
|
||||
navigate('/', { replace: true })
|
||||
|
||||
@@ -275,6 +275,8 @@ export const en: Dict = {
|
||||
'Too many attempts. Wait a few minutes before trying again.',
|
||||
'auth.failure.link_expired': 'This link has expired or was already used.',
|
||||
'auth.failure.session_expired': 'Your session has expired. Sign in again.',
|
||||
'auth.failure.reauthentication_needed':
|
||||
'For security, sign out and sign in again before changing the password.',
|
||||
'auth.failure.provider_disabled': 'This sign-in method is not enabled.',
|
||||
'auth.failure.network': 'Cannot reach the server. Check your network.',
|
||||
'auth.failure.unknown': 'An unexpected error occurred. Try again.',
|
||||
@@ -289,6 +291,8 @@ export const en: Dict = {
|
||||
'shell.nav.local_tool_hint': 'No account, PDF export',
|
||||
'shell.sign_out': 'Sign out',
|
||||
'shell.signing_out': 'Signing out…',
|
||||
'shell.sign_out_failed':
|
||||
'Signed out on this device, but the server did not confirm: your other sessions may stay open.',
|
||||
'shell.loading_session': 'Checking your session…',
|
||||
'shell.role.owner': 'Platform owner',
|
||||
'shell.role.admin': 'Administrator',
|
||||
|
||||
@@ -291,6 +291,8 @@ export const fr: Dict = {
|
||||
'Trop de tentatives. Patientez quelques minutes avant de réessayer.',
|
||||
'auth.failure.link_expired': 'Ce lien a expiré ou a déjà été utilisé.',
|
||||
'auth.failure.session_expired': 'Votre session a expiré. Reconnectez-vous.',
|
||||
'auth.failure.reauthentication_needed':
|
||||
'Par sécurité, déconnectez-vous puis reconnectez-vous avant de changer le mot de passe.',
|
||||
'auth.failure.provider_disabled': "Ce mode de connexion n'est pas activé.",
|
||||
'auth.failure.network': 'Connexion au serveur impossible. Vérifiez votre réseau.',
|
||||
'auth.failure.unknown': "Une erreur inattendue s'est produite. Réessayez.",
|
||||
@@ -305,6 +307,8 @@ export const fr: Dict = {
|
||||
'shell.nav.local_tool_hint': 'Sans compte, export PDF',
|
||||
'shell.sign_out': 'Se déconnecter',
|
||||
'shell.signing_out': 'Déconnexion…',
|
||||
'shell.sign_out_failed':
|
||||
"Déconnecté sur cet appareil, mais le serveur n'a pas confirmé : vos autres sessions peuvent rester ouvertes.",
|
||||
'shell.loading_session': 'Vérification de la session…',
|
||||
'shell.role.owner': 'Propriétaire plateforme',
|
||||
'shell.role.admin': 'Administrateur',
|
||||
|
||||
@@ -137,9 +137,7 @@ export const useAuthStore = create<AuthState>((set, get) => ({
|
||||
},
|
||||
|
||||
signOut: async () => {
|
||||
await signOutRequest(requireClient())
|
||||
// SIGNED_OUT also arrives through the subscription; this keeps the UI honest if it does not.
|
||||
set({
|
||||
const clear = () => set({
|
||||
status: 'signed_out',
|
||||
session: null,
|
||||
user: null,
|
||||
@@ -147,6 +145,13 @@ export const useAuthStore = create<AuthState>((set, get) => ({
|
||||
roles: [],
|
||||
recovery: false,
|
||||
})
|
||||
try {
|
||||
// auth-js clears the local session even when the server call fails.
|
||||
await signOutRequest(requireClient())
|
||||
} finally {
|
||||
// SIGNED_OUT also arrives through the subscription; this keeps the UI honest if it does not.
|
||||
clear()
|
||||
}
|
||||
},
|
||||
|
||||
clearRecovery: () => set({ recovery: false }),
|
||||
|
||||
Reference in new issue
Block a user