Skip to content

Commit 5f28ae9

Browse files
fix: use single sheet for password coordination
1 parent 57634d0 commit 5f28ae9

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public struct AuthPickerView<Content: View> {
3535
extension AuthPickerView: View {
3636
public var body: some View {
3737
@Bindable var authService = authService
38+
@Bindable var passwordPrompt = authService.passwordPrompt
3839
content()
3940
.sheet(isPresented: $authService.isPresented) {
4041
@Bindable var navigator = authService.navigator
@@ -77,6 +78,10 @@ extension AuthPickerView: View {
7778
)
7879
.interactiveDismissDisabled(authService.configuration.interactiveDismissEnabled)
7980
}
81+
// Centralized password prompt sheet to prevent conflicts
82+
.sheet(isPresented: $passwordPrompt.isPromptingPassword) {
83+
PasswordPromptSheet(coordinator: authService.passwordPrompt)
84+
}
8085
// View-layer logic: Handle account conflicts (auto-handle anonymous upgrade, store others for
8186
// linking)
8287
.onChange(of: authService.currentAccountConflict) { _, conflict in

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/MFAManagementView.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public struct MFAManagementView {
5555

5656
extension MFAManagementView: View {
5757
public var body: some View {
58-
@Bindable var passwordPrompt = authService.passwordPrompt
5958
VStack(spacing: 20) {
6059
// Title section
6160
VStack {
@@ -133,10 +132,7 @@ extension MFAManagementView: View {
133132
.onAppear {
134133
loadEnrolledFactors()
135134
}
136-
// Present password prompt when required for reauthentication
137-
.sheet(isPresented: $passwordPrompt.isPromptingPassword) {
138-
PasswordPromptSheet(coordinator: authService.passwordPrompt)
139-
}
135+
// Password prompt sheet now centralized in AuthPickerView
140136
}
141137

142138
@ViewBuilder

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/SignedInView.swift

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ public struct SignedInView {
3838

3939
extension SignedInView: View {
4040
public var body: some View {
41-
@Bindable var passwordPrompt = authService.passwordPrompt
4241
VStack {
4342
Text(authService.string.signedInTitle)
4443
.font(.largeTitle)
@@ -144,9 +143,7 @@ extension SignedInView: View {
144143
)
145144
.presentationDetents([.medium])
146145
}
147-
.sheet(isPresented: $passwordPrompt.isPromptingPassword) {
148-
PasswordPromptSheet(coordinator: authService.passwordPrompt)
149-
}
146+
// Password prompt sheet now centralized in AuthPickerView
150147
.sheet(isPresented: $showEmailVerificationSent) {
151148
VStack(spacing: 24) {
152149
Text(authService.string.verifyEmailSheetMessage)

0 commit comments

Comments
 (0)