Skip to content

fix(ui): always leave the OIDC callback URL after a successful login - #7190

Open
excavador wants to merge 1 commit into
akuity:mainfrom
excavador:fix/ui-oidc-callback-always-redirects
Open

excavador wants to merge 1 commit into
akuity:mainfrom
excavador:fix/ui-oidc-callback-always-redirects

Conversation

@excavador

Copy link
Copy Markdown

Description

Closes #7189

After a successful code exchange the login page only navigated away 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 at the provider.

This always navigates after a successful exchange: to the safe redirectTo when there is one, otherwise to paths.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

  • Linked to an existing issue with no blocking labels (kind/proposal, needs discussion, needs research, maintainer only, area/security, size/large, size/x-large, size/xx-large).
  • Changes documentation only.
  • Changes ten lines or fewer.

Quality

  • Adds or updates corresponding tests. (No existing tests cover OIDCLogin's callback effect; the change is a fallback in a single window.location.replace. Happy to add one if a harness for this component is preferred.)

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]>
@excavador
excavador requested a review from a team as a code owner September 12, 2026 13:20
@kargo-governance-bot kargo-governance-bot Bot added needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed labels Sep 12, 2026
@netlify

netlify Bot commented Sep 12, 2026

Copy link
Copy Markdown

Deploy Preview for docs-kargo-io ready!

Name Link
🔨 Latest commit a0e198f
🔍 Latest deploy log https://app.netlify.com/projects/docs-kargo-io/deploys/6aa551a56320810008ef4d5f
😎 Deploy Preview https://deploy-preview-7190.docs.kargo.io
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs/area Issue or PR needs to be labeled to indicate what parts of the code base are affected needs/kind Issue or PR needs to be labeled to clarify its nature needs/priority Priority has not yet been determined; a good signal that maintainers aren't fully committed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI: after a silent OIDC login the page stays on /login?code=… showing “SSO Login”; a reload replays the code

1 participant