File tree Expand file tree Collapse file tree 6 files changed +7
-0
lines changed
androidMain/kotlin/dev/gitlive/firebase/auth
commonMain/kotlin/dev/gitlive/firebase/auth
commonTest/kotlin/dev/gitlive/firebase/auth
iosMain/kotlin/dev/gitlive/firebase/auth
jsMain/kotlin/dev/gitlive/firebase/auth
firebase-common/src/jsMain/kotlin/dev/gitlive/firebase Expand file tree Collapse file tree 6 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ actual class FirebaseUser internal constructor(val android: com.google.firebase.
6161 get() = android.isAnonymous
6262 actual suspend fun delete () = android.delete().await().run { Unit }
6363 actual suspend fun reload () = android.reload().await().run { Unit }
64+ actual suspend fun sendEmailVerification () = android.sendEmailVerification().await().run { Unit }
6465}
6566
6667actual typealias FirebaseAuthException = com.google.firebase.auth.FirebaseAuthException
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ expect class FirebaseUser {
3434 val isAnonymous: Boolean
3535 suspend fun delete ()
3636 suspend fun reload ()
37+ suspend fun sendEmailVerification ()
3738}
3839
3940expect open class FirebaseAuthException : FirebaseException
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class FirebaseAuthTest {
4141 val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
4242 assertNotEquals(null , createResult.user?.uid)
4343
44+ createResult.user!! .sendEmailVerification()
45+
4446 val signInResult = Firebase .auth.signInWithEmailAndPassword(email, " test123" )
4547 assertEquals(createResult.user?.uid, signInResult.user?.uid)
4648
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ actual class FirebaseUser internal constructor(val ios: FIRUser) {
6262 get() = ios.isAnonymous()
6363 actual suspend fun delete () = ios.await { deleteWithCompletion(it) }.run { Unit }
6464 actual suspend fun reload () = ios.await { reloadWithCompletion(it) }.run { Unit }
65+ actual suspend fun sendEmailVerification () = ios.await { sendEmailVerificationWithCompletion(it) }.run { Unit }
6566}
6667
6768actual open class FirebaseAuthException (message : String ): FirebaseException(message)
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ actual class FirebaseUser internal constructor(val js: firebase.user.User) {
5757 get() = rethrow { js.isAnonymous }
5858 actual suspend fun delete () = rethrow { js.delete().await() }
5959 actual suspend fun reload () = rethrow { js.reload().await() }
60+ actual suspend fun sendEmailVerification () = rethrow { js.sendEmailVerification().await() }
6061}
6162
6263actual open class FirebaseAuthException (code : String? , cause : Throwable ): FirebaseException(code, cause)
Original file line number Diff line number Diff line change @@ -80,6 +80,7 @@ external object firebase {
8080
8181 fun delete (): Promise <Unit >
8282 fun reload (): Promise <Unit >
83+ fun sendEmailVerification (): Promise <Unit >
8384 }
8485 }
8586
You can’t perform that action at this time.
0 commit comments