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.
61
61
get() = android.isAnonymous
62
62
actual suspend fun delete () = android.delete().await().run { Unit }
63
63
actual suspend fun reload () = android.reload().await().run { Unit }
64
+ actual suspend fun sendEmailVerification () = android.sendEmailVerification().await().run { Unit }
64
65
}
65
66
66
67
actual typealias FirebaseAuthException = com.google.firebase.auth.FirebaseAuthException
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ expect class FirebaseUser {
34
34
val isAnonymous: Boolean
35
35
suspend fun delete ()
36
36
suspend fun reload ()
37
+ suspend fun sendEmailVerification ()
37
38
}
38
39
39
40
expect open class FirebaseAuthException : FirebaseException
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ class FirebaseAuthTest {
41
41
val createResult = Firebase .auth.createUserWithEmailAndPassword(email, " test123" )
42
42
assertNotEquals(null , createResult.user?.uid)
43
43
44
+ createResult.user!! .sendEmailVerification()
45
+
44
46
val signInResult = Firebase .auth.signInWithEmailAndPassword(email, " test123" )
45
47
assertEquals(createResult.user?.uid, signInResult.user?.uid)
46
48
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ actual class FirebaseUser internal constructor(val ios: FIRUser) {
62
62
get() = ios.isAnonymous()
63
63
actual suspend fun delete () = ios.await { deleteWithCompletion(it) }.run { Unit }
64
64
actual suspend fun reload () = ios.await { reloadWithCompletion(it) }.run { Unit }
65
+ actual suspend fun sendEmailVerification () = ios.await { sendEmailVerificationWithCompletion(it) }.run { Unit }
65
66
}
66
67
67
68
actual 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) {
57
57
get() = rethrow { js.isAnonymous }
58
58
actual suspend fun delete () = rethrow { js.delete().await() }
59
59
actual suspend fun reload () = rethrow { js.reload().await() }
60
+ actual suspend fun sendEmailVerification () = rethrow { js.sendEmailVerification().await() }
60
61
}
61
62
62
63
actual 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 {
80
80
81
81
fun delete (): Promise <Unit >
82
82
fun reload (): Promise <Unit >
83
+ fun sendEmailVerification (): Promise <Unit >
83
84
}
84
85
}
85
86
You can’t perform that action at this time.
0 commit comments