-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Closed
flutter/packages
#9574Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/p: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
What package does this bug report belong to?
google_sign_in
What target platforms are you seeing this bug on?
Android
Have you already upgraded your packages?
Yes
Steps to reproduce
GoogleSignInAccount googleUser = await GoogleSignIn.instance.authenticate();
windows with selecting the google account opens
close that window
Expected results
migration guide should also mention:
GoogleSignIn.instance.authenticate() throws GoogleSignInException with code GoogleSignInExceptionCode.canceled
instead of
returning null
when the user closes the window/cancel the process
Code sample
Future<OAuthCredential?> _googleLoginCredential() async {
try {
final GoogleSignInAccount googleUser = await GoogleSignIn.instance.authenticate();
final GoogleSignInAuthentication googleAuth = googleUser.authentication;
return GoogleAuthProvider.credential(idToken: googleAuth.idToken);
} catch (e) {
if (e is GoogleSignInException){
if (e.code == GoogleSignInExceptionCode.canceled){
return null;
}
}
rethrow;
}
}
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listd: api docsIssues with https://api.flutter.dev/Issues with https://api.flutter.dev/p: google_sign_inThe Google Sign-In pluginThe Google Sign-In pluginpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.r: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team