Repository navigation
fix(webui): isolate the SSR request cookie behind a registered reader - #1031
Merged
alcholiclg merged 6 commits intoOct 29, 2026
Merged
Conversation
- register the request-cookie reader from auth.server instead of importing it from the API client - detect the server by the absence of `window` so non-bundled runs attach the cookie too
- hold two concurrent auth-status requests to check each request keeps its own cookie across awaits - assert JSON requests send a content type, uploads keep their FormData body and browser requests send no cookie
alcholiclg
approved these changes
Oct 29, 2026
- treat a missing Origin as an allowlist of `same-origin` and `none` fetch sites so a sibling subdomain cannot drive a write - cover the same-site, same-origin and none fetch sites in the auth tests
- move the login path test and the login URL builder into the shared auth module and use them from the middleware and the sign-in link
- ask the auth status once the event stream fails for good and redirect to the login page when the session is no longer authenticated - let the auth status request opt into silent failures
- assert an expired session never reaches the loader and returns to its in-app path without the `.data` suffix - assert the login page itself stays reachable while signed out
alcholiclg
approved these changes
Oct 29, 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.
Summary
auth.serverinstead of dynamically importing it inside the API client, so the client no longer depends on the server modulewindowrather thanimport.meta.env.SSR, so runs outside the bundler also attach the request cookieOriginas an allowlist of thesame-originandnonefetch sites, so a sibling subdomain cannot drive a write through theSameSite=laxsession cookiecheck:authto hold two concurrent auth-status requests and assert each request keeps its own cookie across awaitsFormDatabody, and browser requests send no cookie.datasuffix, and that the login page stays reachable while signed outTest
uv run pytest tests/test_auth.py tests/test_auth_stack.pypnpm check:authpnpm typecheckpnpm build