{{ message }}
fix(console): handle OAuth callback errors gracefully - #47592
Open
faiyaz032 wants to merge 1 commit into
Open
Conversation
Redirect access_denied back to the auth page, return a clean error for other OAuth errors instead of a 500, and stop echoing callback query params.
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.

Issue for this PR
Closes #47590
Closes #40232
Closes #39414
Type of change
What does this PR do?
When a user cancels sign-in (or something fails on the auth server), the provider redirects back to
/auth/callbackwith anerrorparam instead of acode. The callback only looked forcode, so it threw "No authorization code found" and returned a 500 that also echoed the full callback query params (which can include sensitive OAuth values like authorization codes).This PR makes the callback check
error/error_descriptionbefore requiringcode:access_deniedis treated as a normal user cancel and redirects back to the auth page.causefield that echoed the callback query params in the error response.codeflow is unchanged.How did you verify your code works?
Added unit tests covering success,
access_denied, missing code, and other OAuth errors. All pass locally withbun test.Screenshots / recordings
Not a UI change.
Checklist