Skip to content

Commit ed53347

Browse files
fix: move mainactor
1 parent d2521e2 commit ed53347

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AccountService+Email.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@
1515
@preconcurrency import FirebaseAuth
1616
import Observation
1717

18+
@MainActor
1819
protocol EmailPasswordOperationReauthentication {
1920
var passwordPrompt: PasswordPromptCoordinator { get }
2021
}
2122

2223
extension EmailPasswordOperationReauthentication {
23-
@MainActor func reauthenticate() async throws {
24+
func reauthenticate() async throws {
2425
guard let user = Auth.auth().currentUser else {
2526
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
2627
}
@@ -33,7 +34,7 @@ extension EmailPasswordOperationReauthentication {
3334
let password = try await passwordPrompt.confirmPassword()
3435

3536
let credential = EmailAuthProvider.credential(withEmail: email, password: password)
36-
try await Auth.auth().currentUser?.reauthenticate(with: credential)
37+
_ = try await Auth.auth().currentUser?.reauthenticate(with: credential)
3738
} catch {
3839
throw AuthServiceError.signInFailed(underlying: error)
3940
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AccountService.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ public extension AuthenticatedOperation {
4646
}
4747
}
4848

49+
@MainActor
4950
public protocol ProviderOperationReauthentication {
5051
var authProvider: AuthProviderSwift { get }
5152
}
5253

5354
public extension ProviderOperationReauthentication {
54-
@MainActor func reauthenticate() async throws {
55+
func reauthenticate() async throws {
5556
guard let user = Auth.auth().currentUser else {
5657
throw AuthServiceError.reauthenticationRequired("No user currently signed-in")
5758
}

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -719,10 +719,10 @@ public extension AuthService {
719719
}
720720
let password = try await passwordPrompt.confirmPassword()
721721
let credential = EmailAuthProvider.credential(withEmail: email, password: password)
722-
try await user.reauthenticate(with: credential)
722+
_ = try await user.reauthenticate(with: credential)
723723
} else if let matchingProvider = providers.first(where: { $0.id == providerId }) {
724724
let credential = try await matchingProvider.provider.createAuthCredential()
725-
try await user.reauthenticate(with: credential)
725+
_ = try await user.reauthenticate(with: credential)
726726
} else {
727727
throw AuthServiceError.providerNotFound("No provider found for \(providerId)")
728728
}

0 commit comments

Comments
 (0)