Skip to content

Commit 087b721

Browse files
feat: allow consumer to update password prompt
1 parent 65e2365 commit 087b721

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,24 @@ import Observation
1818
@MainActor
1919
@Observable
2020
public final class PasswordPromptCoordinator {
21-
var isPromptingPassword = false
21+
public var isPromptingPassword = false
2222
private var continuation: CheckedContinuation<String, Error>?
2323

24-
func confirmPassword() async throws -> String {
24+
public init() {}
25+
26+
public func confirmPassword() async throws -> String {
2527
return try await withCheckedThrowingContinuation { continuation in
2628
self.continuation = continuation
2729
self.isPromptingPassword = true
2830
}
2931
}
3032

31-
func submit(password: String) {
33+
public func submit(password: String) {
3234
continuation?.resume(returning: password)
3335
cleanup()
3436
}
3537

36-
func cancel() {
38+
public func cancel() {
3739
continuation?
3840
.resume(throwing: AuthServiceError
3941
.signInCancelled("Password entry cancelled for Email provider"))

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ public final class AuthService {
132132
public var authenticationState: AuthenticationState = .unauthenticated
133133
public var authenticationFlow: AuthenticationFlow = .signIn
134134

135-
public let passwordPrompt: PasswordPromptCoordinator = .init()
135+
public var passwordPrompt: PasswordPromptCoordinator = .init()
136136
public var currentMFARequired: MFARequired?
137137
private var currentMFAResolver: MultiFactorResolver?
138138

0 commit comments

Comments
 (0)