File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1515@preconcurrency import FirebaseAuth
1616import Observation
1717
18+ @MainActor
1819protocol EmailPasswordOperationReauthentication {
1920 var passwordPrompt : PasswordPromptCoordinator { get }
2021}
2122
2223extension 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 }
Original file line number Diff line number Diff line change @@ -46,12 +46,13 @@ public extension AuthenticatedOperation {
4646 }
4747}
4848
49+ @MainActor
4950public protocol ProviderOperationReauthentication {
5051 var authProvider : AuthProviderSwift { get }
5152}
5253
5354public 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 }
Original file line number Diff line number Diff 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 }
You can’t perform that action at this time.
0 commit comments