Skip to content

Commit 0802dfa

Browse files
refactor: rename login to signUp
1 parent 6fe345a commit 0802dfa

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Services/AuthService.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public enum AuthenticationState {
4040
}
4141

4242
public enum AuthenticationFlow {
43-
case login
43+
case signIn
4444
case signUp
4545
}
4646

@@ -94,7 +94,7 @@ public final class AuthService {
9494
public let string: StringUtils
9595
public var currentUser: User?
9696
public var authenticationState: AuthenticationState = .unauthenticated
97-
public var authenticationFlow: AuthenticationFlow = .login
97+
public var authenticationFlow: AuthenticationFlow = .signIn
9898
public var errorMessage = ""
9999
public let passwordPrompt: PasswordPromptCoordinator = .init()
100100

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/AuthPickerView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public struct AuthPickerView {
2323

2424
private func switchFlow() {
2525
authService.authenticationFlow = authService
26-
.authenticationFlow == .login ? .signUp : .login
26+
.authenticationFlow == .signIn ? .signUp : .signIn
2727
}
2828

2929
private var isAuthModalPresented: Binding<Bool> {
@@ -59,7 +59,7 @@ extension AuthPickerView: View {
5959
EmailLinkView()
6060
case .authPicker:
6161
if authService.emailSignInEnabled {
62-
Text(authService.authenticationFlow == .login ? authService.string
62+
Text(authService.authenticationFlow == .signIn ? authService.string
6363
.emailLoginFlowLabel : authService.string.emailSignUpFlowLabel)
6464
Divider()
6565
EmailAuthView()
@@ -71,7 +71,7 @@ extension AuthPickerView: View {
7171
Divider()
7272
HStack {
7373
Text(authService
74-
.authenticationFlow == .login ? authService.string.dontHaveAnAccountYetLabel :
74+
.authenticationFlow == .signIn ? authService.string.dontHaveAnAccountYetLabel :
7575
authService.string.alreadyHaveAnAccountLabel)
7676
Button(action: {
7777
withAnimation {

FirebaseSwiftUI/FirebaseAuthSwiftUI/Sources/Views/EmailAuthView.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public struct EmailAuthView {
4141
public init() {}
4242

4343
private var isValid: Bool {
44-
return if authService.authenticationFlow == .login {
44+
return if authService.authenticationFlow == .signIn {
4545
!email.isEmpty && !password.isEmpty
4646
} else {
4747
!email.isEmpty && !password.isEmpty && password == confirmPassword
@@ -98,7 +98,7 @@ extension EmailAuthView: View {
9898
.padding(.bottom, 8)
9999
.accessibilityIdentifier("password-field")
100100

101-
if authService.authenticationFlow == .login {
101+
if authService.authenticationFlow == .signIn {
102102
Button(action: {
103103
authService.authView = .passwordRecovery
104104
}) {
@@ -127,12 +127,12 @@ extension EmailAuthView: View {
127127

128128
Button(action: {
129129
Task {
130-
if authService.authenticationFlow == .login { await signInWithEmailPassword() }
130+
if authService.authenticationFlow == .signIn { await signInWithEmailPassword() }
131131
else { await createUserWithEmailPassword() }
132132
}
133133
}) {
134134
if authService.authenticationState != .authenticating {
135-
Text(authService.authenticationFlow == .login ? authService.string
135+
Text(authService.authenticationFlow == .signIn ? authService.string
136136
.signInWithEmailButtonLabel : authService.string.signUpWithEmailButtonLabel)
137137
.padding(.vertical, 8)
138138
.frame(maxWidth: .infinity)

0 commit comments

Comments
 (0)