Skip to content

Commit 7d7a039

Browse files
update email provider to create user
1 parent 09c8c00 commit 7d7a039

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/FirebaseAuthSwiftUI/Services/EmailProvider.swift

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,8 @@ public class EmailAuthProvider {
1010
}
1111

1212
func signIn(withEmail email: String, password: String) async throws {
13-
authEnvironment.authenticationState = .authenticating
14-
do {
15-
try await authEnvironment.auth.signIn(withEmail: email, password: password)
16-
authEnvironment.updateAuthenticationState()
17-
} catch {
18-
authEnvironment.authenticationState = .unauthenticated
19-
throw error
20-
}
13+
let credential = FirebaseAuth.EmailAuthProvider.credential(withEmail: email, password: password)
14+
try await authEnvironment.signIn(with: credential)
2115
}
2216

2317
func createUser(withEmail email: String, password: String) async throws {

0 commit comments

Comments
 (0)