File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
auth/src/main/java/com/firebase/ui/auth Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1113,7 +1113,22 @@ public GoogleBuilder setSignInOptions(@NonNull GoogleSignInOptions options) {
1113
1113
clientId = getApplicationContext ().getString (R .string .default_web_client_id );
1114
1114
}
1115
1115
1116
- builder .requestEmail ().requestIdToken (clientId );
1116
+ // Warn the user that they are _probably_ doing the wrong thing if they
1117
+ // have not called requestEmail (see issue #1899 and #1621)
1118
+ boolean hasEmailScope = false ;
1119
+ for (Scope s : options .getScopes ()) {
1120
+ if ("email" .equals (s .getScopeUri ())) {
1121
+ hasEmailScope = true ;
1122
+ break ;
1123
+ }
1124
+ }
1125
+ if (!hasEmailScope ) {
1126
+ Log .w (TAG , "The GoogleSignInOptions passed to setSignInOptions does not " +
1127
+ "request the 'email' scope. In most cases this is a mistake! " +
1128
+ "Call requestEmail() on the GoogleSignInOptions object." );
1129
+ }
1130
+
1131
+ builder .requestIdToken (clientId );
1117
1132
getParams ().putParcelable (
1118
1133
ExtraConstants .GOOGLE_SIGN_IN_OPTIONS , builder .build ());
1119
1134
You can’t perform that action at this time.
0 commit comments