Skip to content

Commit

Permalink
Change the type of the scopes and queryParams so that different value…
Browse files Browse the repository at this point in the history
…s can be passed for each providers
  • Loading branch information
dshukertjr committed Jan 23, 2024
1 parent c9fae15 commit 1f2ae38
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/components/supa_socials_auth.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ class SupaSocialsAuth extends StatefulWidget {
final bool showSuccessSnackBar;

/// OpenID scope(s) for provider authorization request (ex. '.default')
final String? scopes;
final Map<OAuthProvider, String>? scopes;

/// Parameters to include in provider authorization request (ex. {'prompt': 'consent'})
final Map<String, String>? queryParams;
final Map<OAuthProvider, Map<String, String>>? queryParams;

const SupaSocialsAuth({
Key? key,
Expand Down Expand Up @@ -217,8 +217,8 @@ class _SupaSocialsAuthState extends State<SupaSocialsAuth> {
await supabase.auth.signInWithOAuth(
socialProvider,
redirectTo: widget.redirectUrl,
scopes: widget.scopes,
queryParams: widget.queryParams,
scopes: widget.scopes?[socialProvider],
queryParams: widget.queryParams?[socialProvider],
);
} on AuthException catch (error) {
if (widget.onError == null && context.mounted) {
Expand Down

0 comments on commit 1f2ae38

Please sign in to comment.