Skip to content

Commit 6bf0308

Browse files
initial password recovery View
1 parent 6af2805 commit 6bf0308

2 files changed

Lines changed: 24 additions & 4 deletions

File tree

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/FirebaseAuthSwiftUI/Views/EmailPasswordView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ extension EmailPasswordView: View {
9090
.padding(.bottom, 8)
9191

9292
if authEnvironment.authenticationFlow == .login {
93-
Button("Forgot password?") {
94-
// TODO: - does this update to a new screen or update in-situ???
95-
}
96-
.frame(maxWidth: .infinity, alignment: .trailing)
93+
NavigationLink(destination: PasswordRecoveryView()
94+
.environment(authEnvironment)) {
95+
Text("Forgotten Password?")
96+
}
9797
}
9898

9999
if authEnvironment.authenticationFlow == .signUp {
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import SwiftUI
2+
3+
public struct PasswordRecoveryView: View {
4+
@State private var email = ""
5+
public var body: some View {
6+
VStack {
7+
Text("Password Recovery")
8+
LabeledContent {
9+
TextField("Email", text: $email)
10+
.textInputAutocapitalization(.never)
11+
.disableAutocorrection(true)
12+
.submitLabel(.next)
13+
} label: {
14+
Image(systemName: "at")
15+
}.padding(.vertical, 6)
16+
.background(Divider(), alignment: .bottom)
17+
.padding(.bottom, 4)
18+
}
19+
}
20+
}

0 commit comments

Comments
 (0)