File tree Expand file tree Collapse file tree
auth/src/main/java/com/firebase/ui/auth Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1113,7 +1113,22 @@ public GoogleBuilder setSignInOptions(@NonNull GoogleSignInOptions options) {
11131113 clientId = getApplicationContext ().getString (R .string .default_web_client_id );
11141114 }
11151115
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 );
11171132 getParams ().putParcelable (
11181133 ExtraConstants .GOOGLE_SIGN_IN_OPTIONS , builder .build ());
11191134
You can’t perform that action at this time.
0 commit comments