fix(app): failed sign-out reported (local session still cleared); reauthentication_needed phrased; docs(docs): exact production redirect allowlist

This commit is contained in:
bchanot committed 2026-10-11 23:45:14 +02:00
1 parent 1aed64b4ef
commit 9771d997f4
7 files changed
+29 -5

No files matched your search

+8 -3
View File
@@ -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 }),