Fix return_to drop on the login page (v0.2.2)#4
Merged
Conversation
The login page dropped return_to: the "Continue with GitHub" button read the error param but never forwarded return_to, so the OAuth start route stored an empty github_return_to cookie and the callback redirected to /auth instead of the deep-link destination. Read return_to from the URL and append it (encoded) to the start link, preserving the error handling. Add tests for the login-button forwarding (with a no-return_to parity case) and for a forwarded return_to landing in the github_return_to cookie.
Service-side fix to the hosted auth login page; no change to the @ampl/kit package API. Note the affected versions in CONSUMING.md.
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
The login page dropped
return_to, so deep-link-after-login always landed the user at/authinstead of their destination. The "Continue with GitHub" button forwarded the error param but notreturn_to, so the OAuth start route stored an emptygithub_return_tocookie and the callback fell back to the base path.Fix
Read
return_tofrom the login URL and append it (percent-encoded) to the GitHub OAuth start link, preserving the existing error handling. Presentation-only — no loader.Scope
ampl-authlogin page. The@ampl/kitpackage API (./ui,./auth,./email) is unchanged — consumers pinning v0.2.2 get the same package code as v0.2.1; the fix takes effect when the auth service is deployed.Tests
return_to; parity case with noreturn_to.return_tolands (decoded) in thegithub_return_tocookie.Full suite green (139 tests); typecheck clean.