File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed
auth/src/main/java/com/firebase/ui/auth Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -283,31 +283,22 @@ public static int getDefaultTheme() {
283
283
*/
284
284
@ NonNull
285
285
public Task <AuthResult > silentSignIn (@ NonNull Context context ,
286
- @ NonNull List <IdpConfig > desiredConfigs ) {
286
+ @ NonNull List <IdpConfig > configs ) {
287
287
if (mAuth .getCurrentUser () != null ) {
288
288
throw new IllegalArgumentException ("User already signed in!" );
289
289
}
290
290
291
- List <IdpConfig > configs = new ArrayList <>();
292
- for (IdpConfig config : desiredConfigs ) {
293
- String provider = config .getProviderId ();
294
- if (provider .equals (EmailAuthProvider .PROVIDER_ID )
295
- || provider .equals (GoogleAuthProvider .PROVIDER_ID )) {
296
- configs .add (config );
297
- }
298
- }
299
-
300
- if (configs .isEmpty ()) {
301
- throw new IllegalArgumentException ("No supported providers were supplied. " +
302
- "Add either Google or email support." );
303
- }
304
-
305
291
final Context appContext = context .getApplicationContext ();
306
292
final IdpConfig google =
307
293
ProviderUtils .getConfigFromIdps (configs , GoogleAuthProvider .PROVIDER_ID );
308
294
final IdpConfig email =
309
295
ProviderUtils .getConfigFromIdps (configs , EmailAuthProvider .PROVIDER_ID );
310
296
297
+ if (google == null && email == null ) {
298
+ throw new IllegalArgumentException ("No supported providers were supplied. " +
299
+ "Add either Google or email support." );
300
+ }
301
+
311
302
GoogleSignInOptions googleOptions = null ;
312
303
if (google != null ) {
313
304
GoogleSignInAccount last = GoogleSignIn .getLastSignedInAccount (appContext );
You can’t perform that action at this time.
0 commit comments