Repository navigation
fix(web): return to the requested page after sign-in - #134
Merged
Merged
Conversation
A signed-out visit to a page such as /settings/providers, which the native apps now link to, redirects to /connect?next=<path>, and signing in returns there instead of to the home page. An ended session does the same. returnPath follows only paths on this site, so next can't send the browser to another origin.
|
React Doctor found no new issues. 🎉 Reviewed by React Doctor for commit |
Merged
Merged
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
When the browser isn't signed in, a visit to an app page now redirects to
/connect?next=<path>, and signing in returns to that path instead of/. An already signed-in visit to/connect?next=…goes straight there, and an ended session sends you to sign-in with the page you were on.returnPathaccepts only paths on this site. It rejects anything that doesn't start with/, starts with//or/\, or points back at/connect, and falls back to/for those.Why
The iOS, macOS and Android apps no longer configure the server. Their links open web settings pages such as
/settings/providers(crumble-project/apple#10, crumble-project/android#14). The browser has its own session, so the link showed sign-in and then dropped you on the home page.Evidence
bun run checkpasses: agents check, lint, format, typecheck, OpenAPI check and 1187 tests.apps/web/lib/session.test.tscovers accepted paths, rejected off-site and/connectvalues, and thenextencoding.Risk & Rollback
Reversibility: Reversible
Blast Radius: The web app's sign-in redirects. No server or API change.
If the redirect misbehaved, the worst case is landing on
/after sign-in, which is the old behavior.