OpenChat
OpenChat copied to clipboard
Logging out from Settings lands on the sign-in page instead of home
Problem
"Log out" in the Settings header shows the "Logged out" toast but leaves the user on the sign-in page (/auth) instead of home.
Repro
- Sign in and open
/settings. - Click "Log out" (top right).
- You land on
/authwith the "Logged out" toast.
Seen on the dev deployment while smoke-testing #84. src/routes/settings.tsx and src/components/header-go-back.tsx are unchanged from main; not re-checked on main itself.
Likely cause
handleSignOut in src/components/header-go-back.tsx awaits signOut() and then navigates to /. Settings is still mounted while that navigation runs, so SettingsLayout's effect (src/routes/settings.tsx:16) sees no user and navigates to /auth, and that navigation wins.
Expected
Home, the same as "Log out" from the avatar menu.
Possible fixes
- Leave Settings before signing out (navigate home, then call
signOut). - Or skip the redirect in
SettingsLayoutwhile a sign-out is in progress.