File tree Expand file tree Collapse file tree 5 files changed +11
-0
lines changed
androidMain/kotlin/dev/gitlive/firebase/auth
commonMain/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 5 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,9 @@ actual class FirebaseAuth internal constructor(val android: com.google.firebase.
24
24
actual suspend fun signInWithEmailAndPassword (email : String , password : String ) =
25
25
AuthResult (android.signInWithEmailAndPassword(email, password).await())
26
26
27
+ actual suspend fun createUserWithEmailAndPassword (email : String , password : String ) =
28
+ AuthResult (android.createUserWithEmailAndPassword(email, password).await())
29
+
27
30
actual suspend fun signInWithCustomToken (token : String ) =
28
31
AuthResult (android.signInWithCustomToken(token).await())
29
32
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ expect class FirebaseAuth {
18
18
val currentUser: FirebaseUser ?
19
19
val authStateChanged: Flow <FirebaseUser ?>
20
20
suspend fun signInWithEmailAndPassword (email : String , password : String ): AuthResult
21
+ suspend fun createUserWithEmailAndPassword (email : String , password : String ): AuthResult
21
22
suspend fun signInWithCustomToken (token : String ): AuthResult
22
23
suspend fun signInAnonymously (): AuthResult
23
24
suspend fun signOut ()
Original file line number Diff line number Diff line change @@ -29,6 +29,9 @@ actual class FirebaseAuth internal constructor(val ios: FIRAuth) {
29
29
actual suspend fun signInWithEmailAndPassword (email : String , password : String ) =
30
30
AuthResult (ios.awaitResult { signInWithEmail(email = email, password = password, completion = it) })
31
31
32
+ actual suspend fun createUserWithEmailAndPassword (email : String , password : String ) =
33
+ AuthResult (ios.awaitResult { createUserWithEmail(email = email, password = password, completion = it) })
34
+
32
35
actual suspend fun signInWithCustomToken (token : String ) =
33
36
AuthResult (ios.awaitResult { signInWithCustomToken(token, it) })
34
37
Original file line number Diff line number Diff line change @@ -23,6 +23,9 @@ actual class FirebaseAuth internal constructor(val js: firebase.auth.Auth) {
23
23
actual suspend fun signInWithEmailAndPassword (email : String , password : String ) =
24
24
rethrow { AuthResult (js.signInWithEmailAndPassword(email, password).await()) }
25
25
26
+ actual suspend fun createUserWithEmailAndPassword (email : String , password : String ) =
27
+ rethrow { AuthResult (js.createUserWithEmailAndPassword(email, password).await()) }
28
+
26
29
actual suspend fun signInWithCustomToken (token : String )
27
30
= rethrow { AuthResult (js.signInWithCustomToken(token).await()) }
28
31
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ external object firebase {
58
58
val currentUser: user.User ?
59
59
60
60
fun signInWithEmailAndPassword (email : String , password : String ): Promise <AuthResult >
61
+ fun createUserWithEmailAndPassword (email : String , password : String ): Promise <AuthResult >
61
62
fun signInWithCustomToken (token : String ): Promise <AuthResult >
62
63
fun signInAnonymously (): Promise <AuthResult >
63
64
fun signOut (): Promise <Unit >
You can’t perform that action at this time.
0 commit comments