Repository navigation
fix(auth): recognize error query parameter in auth callback redirects - #1472
Merged
spydon merged 1 commit intoJun 26, 2026
Conversation
OAuth error redirects can arrive as query parameters without an error_description (e.g. ?error=access_denied), per RFC 6749 4.1.2.1 where error_description is optional. The deep link gate only matched error_description and getSessionFromUrl only threw when error_description was present, so bare error redirects were silently dropped and the user saw no feedback. Widen the deep link gate to also match error and error_code, and make getSessionFromUrl throw for any of error, error_code, or error_description, falling back to a generic message when no description is given.
Tr00d
approved these changes
Jun 26, 2026
spydon
deleted the
lukasklingsbo/sdk-1032-parityauth-recognize-error-parameter-in-implicit-grant
branch
June 26, 2026 13:41
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.
What
OAuth error redirects can arrive as query parameters without an
error_description(e.g.?error=access_denied), per RFC 6749 §4.1.2.1 whereerror_descriptionis optional buterroris required.Previously these bare
?error=redirects were silently dropped in two places:supabase_auth.dart→_isAuthCallbackDeeplinkonly matchederror_description, so a?error=access_denieddeep link was never recognized as an auth callback.gotrue_client.dart→getSessionFromUrlonly threw whenerror_description != null, so even if the gate passed, a bare?error=fell through to the misleading"No access_token detected."instead of surfacing the actual OAuth error.The result was that the user saw no feedback when an OAuth provider returned an error without a description.
Changes
erroranderror_code.getSessionFromUrlthrow for any oferror/error_code/error_description, with a fallback message when no description is given. Theerror->codeanderror_code->statusCodemapping is preserved.Tests
packages/gotrue/test/provider_test.dart: new case for?error=access_denied&error_code=403asserting theAuthExceptioncarries the code and status.packages/supabase_flutter/test/deep_link_test.dart: new group asserting a?error=deep link triggersgetSessionFromUrland surfaces theAuthExceptionononAuthStateChange.Parity
Ports supabase-js#2407 to Dart/Flutter.
Resolves SDK-1032 (and its duplicate SDK-1044).