Conversation
After a successful code exchange the login page only navigated when a redirectTo had been carried into the flow. Logout lands on a bare /login, so the next sign-in carries none; when the provider still holds a session it admits the browser silently, and Kargo stores the tokens and then stays on /login?code=... rendering the login button. A reload of that URL replays the authorization code, which the provider refuses and may answer by revoking the session it just issued (RFC 6749 4.1.2), so every reload produces a fresh session. Always navigate: to the safe redirectTo when there is one, otherwise to home. Co-Authored-By: Claude Fable 5.1 <[email protected]> Signed-off-by: Oleg Tsarev <[email protected]>
✅ Deploy Preview for docs-kargo-io ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
Description
Closes #7189
After a successful code exchange the login page only navigated away when a
redirectTohad been carried into the flow. Logout lands on a bare/login, so the next sign-in carries none; when the provider still holds a session it admits the browser silently, and Kargo stores the tokens and then stays on/login?code=…rendering the login button. A reload of that URL replays the authorization code, which the provider refuses and may answer by revoking the session it just issued (RFC 6749 §4.1.2), so every reload produces a fresh session at the provider.This always navigates after a successful exchange: to the safe
redirectTowhen there is one, otherwise topaths.home. No behaviour change for the path that already worked (a login started from/login?redirectTo=…).Reproduced and verified headless against our OIDC provider on v1.11.2; the code is identical on
main.Checklist
Eligibility
kind/proposal,needs discussion,needs research,maintainer only,area/security,size/large,size/x-large,size/xx-large).Quality
OIDCLogin's callback effect; the change is a fallback in a singlewindow.location.replace. Happy to add one if a harness for this component is preferred.)