Repository navigation
app/: signing out lands on the site; signing in never returns to an API path (sc-8900) - #122
Merged
Merged
Conversation
…an API path (sc-8900) - The app's / decides on the session, not the cookie: signing out leaves a new, signed-out session, so the check moved from route_by_host (before sessions) to app_shell, which reads it. - Sign-out navigates to the site (visualci.com), and the app's host never renders the landing page (Home goes to the site instead). - After sign-in, the return address (return_to, or the page Laravel remembered) must be a page on the app: never /api, /auth, /mcp, /webhooks, /internal or the OAuth server's endpoints (the consent page is a page).
ndbroadbent
force-pushed
the
app-signout-site
branch
from
December 3, 2026 07:12
00b5541 to
248898f
Compare
…th index.html before the session check
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.
Two sign-in bugs Nathan hit in production on 3 Dec 2026.
Signing out showed the landing page at app.visualci.com
The app's
/sent visitors to the site only when they had no session cookie. Signing out leaves a new, signed-out session (and its cookie), so the SPA was served, and it rendered the landing page for a signed-out visitor.route_by_host, which runs before sessions start, intoapp_shell, which reads the session: on the app's host, a signed-out/is a 307 toVISUALCI_SITE_URL.siteUrl('/')), not the app's/.Landing: signed out there,Homegoes to the site. The landing page shows only on the site's host and on a single-origin server (dev, self-hosted)."Sign in" landed on the JSON of /api/ui/me
The page's signed-out
GET /api/ui/me, sent withoutAccept: application/json(#120 fixes the client), went through Laravel'sAuthenticate, which redirected it and remembered it asurl.intended. Signing in from the site (noreturn_to) then returned there.return_toor the remembered page, must be a page on the app./api,/auth,/mcp,/webhooks,/internal,/.well-knownand the OAuth server's endpoints are refused, judged as the router reads the path (/%61pi/...is/api); the consent page,/oauth/authorize, is still a page. A remembered URL must be on the app's host. Anything else lands on/.Tests
Written first and seen failing on main (200 instead of 307; redirects to
/api/ui/me), then passing:signing_out_lands_on_the_site: four hosts, sign in, sign out, then the app's/with the cookies the browser keeps is a 307 to the site, and/auth/sessionsays signed out.signing_in_never_returns_to_an_api_path: a signed-out/api/ui/methat asks for HTML, then sign-in from the site, lands on/(200).an_unsafe_return_address_is_ignored: also/api/ui/me,/%2561pi/ui/me,/auth/github,/oauth/token,/mcp,/webhooks/github.home.test.tsx: the landing page renders off the app's host, and never on it, where the page goes to the site.App tests pass on the build box, except the blob tests, which need S3 (CI has it). clippy is clean, and the frontend build and vitest pass.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.