changed names of some methods
This commit is contained in:
parent
eba5461ae9
commit
d9733bedee
1 changed files with 3 additions and 19 deletions
|
@ -47,7 +47,7 @@ class FirebaseAccountDAO @Inject constructor(
|
||||||
awaitClose { auth.removeAuthStateListener(listener) }
|
awaitClose { auth.removeAuthStateListener(listener) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun authenticate(email: String, password: String) {
|
override suspend fun signInWithEmailAndPassword(email: String, password: String) {
|
||||||
auth.signInWithEmailAndPassword(email, password).await()
|
auth.signInWithEmailAndPassword(email, password).await()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,14 +55,8 @@ class FirebaseAccountDAO @Inject constructor(
|
||||||
auth.sendPasswordResetEmail(email).await()
|
auth.sendPasswordResetEmail(email).await()
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun createAnonymousAccount() {
|
override suspend fun signUpWithEmailAndPassword(email: String, password: String) {
|
||||||
auth.signInAnonymously().await()
|
auth.createUserWithEmailAndPassword(email, password).await()
|
||||||
}
|
|
||||||
|
|
||||||
override suspend fun linkAccount(email: String, password: String): Unit =
|
|
||||||
trace(LINK_ACCOUNT_TRACE) {
|
|
||||||
val credential = EmailAuthProvider.getCredential(email, password)
|
|
||||||
auth.currentUser!!.linkWithCredential(credential).await()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun deleteAccount() {
|
override suspend fun deleteAccount() {
|
||||||
|
@ -70,16 +64,6 @@ class FirebaseAccountDAO @Inject constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun signOut() {
|
override suspend fun signOut() {
|
||||||
if (auth.currentUser!!.isAnonymous) {
|
|
||||||
auth.currentUser!!.delete()
|
|
||||||
}
|
|
||||||
auth.signOut()
|
auth.signOut()
|
||||||
|
|
||||||
// Sign the user back in anonymously.
|
|
||||||
createAnonymousAccount()
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
private const val LINK_ACCOUNT_TRACE = "linkAccount"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue