Skip to content

Commit 427d9c5

Browse files
add modal after password recovery email sent
1 parent 82a82b0 commit 427d9c5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/FirebaseAuthSwiftUI/Views/PasswordRecoveryView.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public struct PasswordRecoveryView {
44
@Environment(AuthEnvironment.self) private var authEnvironment
55
@State private var email = ""
66
@State private var errorMessage = ""
7+
@State private var showModal = false
78

89
private var provider: EmailPasswordAuthProvider
910

@@ -14,6 +15,7 @@ public struct PasswordRecoveryView {
1415
private func sendPasswordRecoveryEmail() async {
1516
do {
1617
try await provider.sendPasswordRecoveryEmail(withEmail: email)
18+
showModal = true
1719
} catch {
1820
errorMessage = error.localizedDescription
1921
}
@@ -54,6 +56,18 @@ extension PasswordRecoveryView: View {
5456
.padding([.top, .bottom], 8)
5557
.frame(maxWidth: .infinity)
5658
.buttonStyle(.borderedProminent)
59+
}.sheet(isPresented: $showModal) {
60+
VStack {
61+
Text("Instructions")
62+
.font(.headline)
63+
Text("Please check your email for password recovery instructions.")
64+
.padding()
65+
Button("Dismiss") {
66+
showModal = false
67+
}
68+
.padding()
69+
}
70+
.padding()
5771
}
5872
}
5973
}

0 commit comments

Comments
 (0)