From 381e8ef9c14b96736c76308a3c2e8a18134d6256 Mon Sep 17 00:00:00 2001 From: ndnam198 Date: Sat, 26 Oct 2024 15:33:18 +0700 Subject: [PATCH] provide minimum google authentication scope --- lib/src/components/supa_socials_auth.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/src/components/supa_socials_auth.dart b/lib/src/components/supa_socials_auth.dart index 4e21f71..f7edf5f 100644 --- a/lib/src/components/supa_socials_auth.dart +++ b/lib/src/components/supa_socials_auth.dart @@ -158,9 +158,15 @@ class _SupaSocialsAuthState extends State { required String? webClientId, required String? iosClientId, }) async { + final scopes = widget.scopes != null + ? widget.scopes![OAuthProvider.google]?.split(',') + : null; + final GoogleSignIn googleSignIn = GoogleSignIn( clientId: iosClientId, serverClientId: webClientId, + // These default values ['email', 'profile'] are needed as to gogole authenitcation recent update + scopes: scopes ?? ['email', 'profile'], ); final googleUser = await googleSignIn.signIn();