Skip to content

Commit a234df1

Browse files
committed
More feedback
Signed-off-by: Alex Saveau <[email protected]>
1 parent a0794ab commit a234df1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

auth/src/main/java/com/firebase/ui/auth/AuthUI.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -299,8 +299,10 @@ public Task<AuthResult> silentSignIn(@NonNull Context context,
299299
"Add either Google or email support.");
300300
}
301301

302-
GoogleSignInOptions googleOptions = null;
303-
if (google != null) {
302+
final GoogleSignInOptions googleOptions;
303+
if (google == null) {
304+
googleOptions = null;
305+
} else {
304306
GoogleSignInAccount last = GoogleSignIn.getLastSignedInAccount(appContext);
305307
if (last != null && last.getIdToken() != null) {
306308
return mAuth.signInWithCredential(GoogleAuthProvider.getCredential(
@@ -311,7 +313,6 @@ public Task<AuthResult> silentSignIn(@NonNull Context context,
311313
.getParcelable(ExtraConstants.GOOGLE_SIGN_IN_OPTIONS);
312314
}
313315

314-
final GoogleSignInOptions finalGoogleOptions = googleOptions;
315316
return GoogleApiUtils.getCredentialsClient(context)
316317
.request(new CredentialRequest.Builder()
317318
// 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) {
331332

332333
if (TextUtils.isEmpty(password)) {
333334
return GoogleSignIn.getClient(appContext,
334-
new GoogleSignInOptions.Builder(finalGoogleOptions)
335+
new GoogleSignInOptions.Builder(googleOptions)
335336
.setAccountName(email)
336337
.build())
337338
.silentSignIn()

0 commit comments

Comments
 (0)