File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
auth/src/main/java/com/firebase/ui/auth Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -299,8 +299,10 @@ public Task<AuthResult> silentSignIn(@NonNull Context context,
299
299
"Add either Google or email support." );
300
300
}
301
301
302
- GoogleSignInOptions googleOptions = null ;
303
- if (google != null ) {
302
+ final GoogleSignInOptions googleOptions ;
303
+ if (google == null ) {
304
+ googleOptions = null ;
305
+ } else {
304
306
GoogleSignInAccount last = GoogleSignIn .getLastSignedInAccount (appContext );
305
307
if (last != null && last .getIdToken () != null ) {
306
308
return mAuth .signInWithCredential (GoogleAuthProvider .getCredential (
@@ -311,7 +313,6 @@ public Task<AuthResult> silentSignIn(@NonNull Context context,
311
313
.getParcelable (ExtraConstants .GOOGLE_SIGN_IN_OPTIONS );
312
314
}
313
315
314
- final GoogleSignInOptions finalGoogleOptions = googleOptions ;
315
316
return GoogleApiUtils .getCredentialsClient (context )
316
317
.request (new CredentialRequest .Builder ()
317
318
// We can support both email and Google at the same time here because they
@@ -331,7 +332,7 @@ public Task<AuthResult> then(@NonNull Task<CredentialRequestResponse> task) {
331
332
332
333
if (TextUtils .isEmpty (password )) {
333
334
return GoogleSignIn .getClient (appContext ,
334
- new GoogleSignInOptions .Builder (finalGoogleOptions )
335
+ new GoogleSignInOptions .Builder (googleOptions )
335
336
.setAccountName (email )
336
337
.build ())
337
338
.silentSignIn ()
You can’t perform that action at this time.
0 commit comments