Skip to content

Commit 43c7394

Browse files
committed
FirebaseAuthExts.kt: Add extension function to await sending password reset email
1 parent 2a30200 commit 43c7394

File tree

1 file changed

+9
-0
lines changed
  • exts/firebase/core/src/main/kotlin/com/edricchan/studybuddy/exts/firebase/auth

1 file changed

+9
-0
lines changed

exts/firebase/core/src/main/kotlin/com/edricchan/studybuddy/exts/firebase/auth/FirebaseAuthExts.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ suspend inline fun FirebaseAuth.awaitSignInWithGoogle(credential: GoogleIdTokenC
7272
return signInWithCredential(firCredential).await()
7373
}
7474

75+
/**
76+
* Triggers the Firebase Authentication backend to send a password-reset email
77+
* to the given email address, which must correspond to an existing user of your app.
78+
* @see FirebaseAuth.sendPasswordResetEmail
79+
*/
80+
suspend inline fun FirebaseAuth.awaitSendPasswordResetEmail(email: String) {
81+
sendPasswordResetEmail(email).await()
82+
}
83+
7584
/** Gets the [currently signed-in user][FirebaseAuth.getCurrentUser] as a [Flow]. */
7685
inline val FirebaseAuth.currentUserFlow: Flow<FirebaseUser?>
7786
get() = callbackFlow {

0 commit comments

Comments
 (0)