From 1f2ae38632ecdffe25b77426c3a21b02d46b5b53 Mon Sep 17 00:00:00 2001 From: dshukertjr Date: Tue, 23 Jan 2024 16:27:48 +0900 Subject: [PATCH] Change the type of the scopes and queryParams so that different values can be passed for each providers --- lib/src/components/supa_socials_auth.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/components/supa_socials_auth.dart b/lib/src/components/supa_socials_auth.dart index 9525eb7..d0d9d4e 100644 --- a/lib/src/components/supa_socials_auth.dart +++ b/lib/src/components/supa_socials_auth.dart @@ -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? scopes; /// Parameters to include in provider authorization request (ex. {'prompt': 'consent'}) - final Map? queryParams; + final Map>? queryParams; const SupaSocialsAuth({ Key? key, @@ -217,8 +217,8 @@ class _SupaSocialsAuthState extends State { 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) {