Skip to content

Commit 393c238

Browse files
update auth env to use auth instance
1 parent b15292c commit 393c238

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/FirebaseAuthSwiftUI/Services/AuthEnvironment.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public final class AuthEnvironment {
4242

4343
deinit {
4444
if let handle = authStateHandle {
45-
Auth.auth().removeStateDidChangeListener(handle)
45+
auth.removeStateDidChangeListener(handle)
4646
authStateHandle = nil
4747
}
4848
}
@@ -51,7 +51,7 @@ public final class AuthEnvironment {
5151
public var authenticationFlow: AuthenticationFlow = .login
5252

5353
private func setupAuthenticationListener() {
54-
authStateHandle = Auth.auth().addStateDidChangeListener { [weak self] _, user in
54+
authStateHandle = auth.addStateDidChangeListener { [weak self] _, user in
5555
self?.currentUser = user
5656
self?.updateAuthenticationState()
5757
}
@@ -60,7 +60,7 @@ public final class AuthEnvironment {
6060
private nonisolated(unsafe) var authStateHandle: AuthStateDidChangeListenerHandle? {
6161
willSet {
6262
if let handle = authStateHandle {
63-
Auth.auth().removeStateDidChangeListener(handle)
63+
auth.removeStateDidChangeListener(handle)
6464
}
6565
}
6666
}
@@ -72,12 +72,12 @@ public final class AuthEnvironment {
7272
: .authenticated
7373
}
7474

75-
public func signOut() throws {
76-
try Auth.auth().signOut()
75+
public func signOut() async throws {
76+
try await auth.signOut()
7777
}
7878

7979
func signIn(with credentials: AuthCredential) async throws {
80-
try await Auth.auth().signIn(with: credentials)
80+
try await auth.signIn(with: credentials)
8181
updateAuthenticationState()
8282
}
8383
}

0 commit comments

Comments
 (0)