Skip to content

Commit 9759cc8

Browse files
author
Rijuth Menon
committed
fixed google sign in cancelled error
1 parent 06d0f77 commit 9759cc8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lib/app/data/providers/google_cloud_api_provider.dart

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,15 @@ class GoogleCloudProvider {
2727
var googleSignInAccount = await _googleSignIn.signIn();
2828
final GoogleSignInAuthentication? googleAuth =
2929
await googleSignInAccount?.authentication;
30-
final credential = GoogleAuthProvider.credential(
31-
accessToken: googleAuth?.accessToken,
32-
idToken: googleAuth?.idToken,
33-
);
34-
await _firebaseAuthInstance.signInWithCredential(credential);
30+
if (googleAuth != null)
31+
{
32+
final credential = GoogleAuthProvider.credential(
33+
accessToken: googleAuth?.accessToken,
34+
idToken: googleAuth?.idToken,
35+
);
36+
await _firebaseAuthInstance.signInWithCredential(credential);
37+
}
38+
3539

3640
if (googleSignInAccount != null) {
3741
// Process successful sign-in

0 commit comments

Comments
 (0)