fix(ui): return to landing page on logout - #356
Merged
Conversation
index.html enforces "logged-in users go straight to /app" but nothing implemented the return trip, so logout left the user on the signed-in shell, whose home re-renders as the "Guest Account" demo portfolio -- the same screen a never-signed-in visitor gets. Redirect in logoutUser only, not clearAuthState: the latter is also reached from refreshAuthUser's 401 branch on every guest page load, and /app supports guests on purpose. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014K97GJdZ2yxAwQ3mhDaGBG
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Logging out left the user on
/app, whose home re-renders as the "Guest Account" demo portfolio — the same screen a never-signed-in visitor gets. Only feedback that anything happened was the header swapping to "Sign in".Not a stale-state bug: every module resets correctly post-logout. It was the correct guest render on the wrong surface.
index.htmldeclares the rule ("Landing is for first-time / logged-out visitors only") and enforces only the signed-in half —/with a cachedauth-userredirects to/app. The return trip was never built.syncHeaderBrandalready repoints the brand to/on sign-out, so the app knew home had moved.Redirect goes in
logoutUser, notclearAuthState— the latter is also reached fromrefreshAuthUser's 401 branch on every guest page load, and/appsupports guests on purpose (backtests work signed-out). A redirect there would evict first-time visitors. Guard test pins this.Clears run before the redirect (else the landing bounces back to
/app);replacenothrefso Back can't restore the shell.Behavior note: logout now returns to
/from any page, not just home.Verified in headless Chromium (logout from home + account page, no bounce loop, guest
/appunaffected). 6 new guards, red 3/6 in the right shape before the fix. Suite: 2885 passed, 78 skipped.🤖 Generated with Claude Code
https://claude.ai/code/session_014K97GJdZ2yxAwQ3mhDaGBG