Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/supabase/lib/src/supabase_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ class SupabaseClient {
autoRefreshToken: authOptions.autoRefreshToken,
authAsyncStorage: authOptions.pkceAsyncStorage,
authFlowType: authOptions.authFlowType,
appendPkceFlowIdToRedirects: authOptions.appendPkceFlowIdToRedirects,
);
_authHttpClient = AuthHttpClient(
_supabaseKey,
Expand Down Expand Up @@ -327,6 +328,7 @@ class SupabaseClient {
required bool autoRefreshToken,
required AuthAsyncStorage? authAsyncStorage,
required AuthFlowType authFlowType,
required bool appendPkceFlowIdToRedirects,
}) {
final authHeaders = {...headers};
authHeaders['apikey'] = _supabaseKey;
Expand All @@ -339,6 +341,7 @@ class SupabaseClient {
httpClient: _authApiHttpClient,
asyncStorage: authAsyncStorage,
flowType: authFlowType,
appendPkceFlowIdToRedirects: appendPkceFlowIdToRedirects,
);
}

Expand Down
9 changes: 9 additions & 0 deletions packages/supabase/lib/src/supabase_client_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ class AuthClientOptions {
final AuthAsyncStorage? pkceAsyncStorage;
final AuthFlowType authFlowType;

/// Whether to append the reserved `sb_flow_id` query parameter to the
/// redirect URL of pkce flows, so a callback can be matched to the flow that
/// started it.
///
/// Check your redirect URL allow list first, see
/// [AuthClient.appendPkceFlowIdToRedirects].
final bool appendPkceFlowIdToRedirects;

const AuthClientOptions({
this.autoRefreshToken = true,
this.pkceAsyncStorage,
this.authFlowType = AuthFlowType.pkce,
this.appendPkceFlowIdToRedirects = false,
});
}

Expand Down
Loading