Skip to content

Commit 040414c

Browse files
committed
refactor
1 parent 25efe1c commit 040414c

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/main/java/com/google/firebase/auth/FirebaseAuth.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,10 @@ class FirebaseAuth constructor(
374374
setResult = { responseBody ->
375375
FirebaseUserImpl(app, jsonParser.parseToJsonElement(responseBody).jsonObject)
376376
},
377-
).task.continueWith {
377+
).task.addOnSuccessListener {
378378
updateByGetAccountInfo()
379379
}
380-
return source.result
380+
return source
381381
}
382382

383383
internal fun updateByGetAccountInfo(): Task<AuthResult> {

src/test/kotlin/AuthTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,21 @@ class AuthTest : FirebaseTest() {
5353
assertEquals(false, auth.currentUser?.isAnonymous)
5454
}
5555

56+
/*@Test
57+
fun `should authenticate via custom token`() =
58+
runTest {
59+
val user = auth.createUserWithEmailAndPassword(email, "test123").await()
60+
auth
61+
.signInWithCustomToken(
62+
user.user
63+
.getIdToken(false)
64+
.await()
65+
.token ?: "",
66+
).await()
67+
68+
assertEquals(false, auth.currentUser?.isAnonymous)
69+
}*/
70+
5671
@Test
5772
fun `should update displayName and photoUrl`() =
5873
runTest {

0 commit comments

Comments
 (0)