feat: handle replayed OIDC callbacks and improve auth error handling - #325
Merged
vinit-truefoundry merged 5 commits intoAug 19, 2026
Conversation
vinit-truefoundry
requested review from
heerambavi1998,
sr07asthana and
thesujai
August 18, 2026 13:15
vinit-truefoundry
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
govindavashishtha,
qaifi-tf and
sayan-truefoundry
as code owners
August 18, 2026 13:15
🦋 Changeset detectedLatest commit: 711ad3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 5afb6d1. Configure here.
…tings-or-chat-it-sends-to-login-failed
sayan-truefoundry
approved these changes
Aug 19, 2026
Co-authored-by: sayan-truefoundry <136362719+sayan-truefoundry@users.noreply.github.com>
…tings-or-chat-it-sends-to-login-failed
vinit-truefoundry
enabled auto-merge (squash)
August 19, 2026 11:19
vinit-truefoundry
deleted the
bugfix/AGE-1830/on-clicking-go-back-from-settings-or-chat-it-sends-to-login-failed
branch
August 19, 2026 11:58
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.

Note
Medium Risk
Changes OIDC callback redirect logic and frontend auth gating; scoped to replay/stale-error handling with tests, but touches security-sensitive login flows.
Overview
Fixes the case where browser Back after a successful OIDC login replays the callback URL and leaves
?error=login_failedon the address bar even though the user is still authenticated.Backend (
/callback): Before redirecting to/?error=…, the handler now checks an existing session viaresolveAuthUser. On state mismatch, IdP error, or failed code exchange, authenticated users are redirected home (orreturn_to) instead of the error landing.Frontend: Session probing runs even when
?error=is present, so a valid session is detected instead of skipping the probe. The auth error screen only appears when the session is unauthenticated (shouldShowAuthErrorScreen). After authentication, staleerrorquery params are stripped withhistory.replaceStateviastripAuthErrorSearch.Unit tests cover the new URL helpers and callback replay paths.
Reviewed by Cursor Bugbot for commit 711ad3c. Bugbot is set up for automated code reviews on this repo. Configure here.