File tree Expand file tree Collapse file tree 3 files changed +11
-12
lines changed
FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources Expand file tree Collapse file tree 3 files changed +11
-12
lines changed Original file line number Diff line number Diff line change @@ -138,7 +138,12 @@ public final class AuthService {
138138
139139 private var listenerManager : AuthListenerManager ?
140140
141- private( set) var emailProvider : EmailProviderSwift ?
141+ private var emailProvider : EmailProviderSwift ?
142+
143+ public var passwordPrompt : PasswordPromptCoordinator {
144+ emailProvider? . passwordPrompt ?? PasswordPromptCoordinator ( )
145+ }
146+
142147 var emailSignInEnabled = false
143148 private var emailSignInCallback : ( ( ) -> Void ) ?
144149
Original file line number Diff line number Diff line change @@ -33,11 +33,10 @@ public struct AuthPickerView<Content: View> {
3333extension AuthPickerView : View {
3434 public var body : some View {
3535 @Bindable var authService = authService
36- @Bindable var passwordPrompt = authService. emailProvider?
37- . passwordPrompt ?? PasswordPromptCoordinator ( )
3836 content ( )
3937 . sheet ( isPresented: $authService. isPresented) {
4038 @Bindable var navigator = authService. navigator
39+ @Bindable var passwordPrompt = authService. passwordPrompt
4140 NavigationStack ( path: $navigator. routes) {
4241 authPickerViewInternal
4342 . navigationTitle ( authService. authenticationState == . unauthenticated ? authService
@@ -80,10 +79,10 @@ extension AuthPickerView: View {
8079 . accountConflictHandler ( )
8180 // Apply MFA handling at NavigationStack level
8281 . mfaHandler ( )
83- }
84- // Centralized password prompt sheet to prevent conflicts
85- . sheet ( isPresented : $ passwordPrompt. isPromptingPassword ) {
86- PasswordPromptSheet ( coordinator : passwordPrompt )
82+ // Centralized password prompt sheet inside auth flow
83+ . sheet ( isPresented : $passwordPrompt . isPromptingPassword ) {
84+ PasswordPromptSheet ( coordinator : passwordPrompt)
85+ }
8786 }
8887 }
8988
Original file line number Diff line number Diff line change @@ -53,8 +53,6 @@ public struct UpdatePasswordView {
5353
5454extension UpdatePasswordView : View {
5555 public var body : some View {
56- @Bindable var passwordPrompt = authService. emailProvider?
57- . passwordPrompt ?? PasswordPromptCoordinator ( )
5856 VStack ( spacing: 24 ) {
5957 AuthTextField (
6058 text: $password,
@@ -116,9 +114,6 @@ extension UpdatePasswordView: View {
116114 } message: {
117115 Text ( " Your password has been successfully updated. " )
118116 }
119- . sheet ( isPresented: $passwordPrompt. isPromptingPassword) {
120- PasswordPromptSheet ( coordinator: passwordPrompt)
121- }
122117 }
123118}
124119
You can’t perform that action at this time.
0 commit comments