@@ -129,7 +129,7 @@ public final class AuthService {
129129
130130 private var currentMFAResolver : MultiFactorResolver ?
131131 private var listenerManager : AuthListenerManager ?
132- private var emailSignInCallback : ( ( ) -> Void ) ?
132+ private var emailLinkSignInCallback : ( ( ) -> Void ) ?
133133 private var providers : [ AuthProviderUI ] = [ ]
134134
135135 public let configuration : AuthConfiguration
@@ -139,7 +139,8 @@ public final class AuthService {
139139 public var currentUser : User ?
140140 public var authenticationState : AuthenticationState = . unauthenticated
141141 public var authenticationFlow : AuthenticationFlow = . signIn
142- public var emailSignInEnabled = false
142+ public var emailPasswordSignInEnabled = false
143+ public var emailLinkSignInEnabled = false
143144 public private( set) var navigator = Navigator ( )
144145
145146 public var authView : AuthView ? {
@@ -153,13 +154,13 @@ public final class AuthService {
153154 public func renderButtons( spacing: CGFloat = 16 ) -> AnyView {
154155 AnyView (
155156 VStack ( spacing: spacing) {
156- if emailSignInEnabled {
157+ if emailLinkSignInEnabled {
157158 AuthProviderButton (
158159 label: string. signInWithEmailLinkViewTitle,
159160 style: . email,
160161 accessibilityId: " sign-in-with-email-link-button "
161162 ) {
162- if let callback = self . emailSignInCallback {
163+ if let callback = self . emailLinkSignInCallback {
163164 callback ( )
164165 } else {
165166 self . navigator. push ( . emailLink)
@@ -345,17 +346,9 @@ public extension AuthService {
345346// MARK: - Email/Password Sign In
346347
347348public extension AuthService {
348- /// Enable email sign-in with default behavior (navigates to email link view )
349+ /// Enable email/password sign-in (EmailAuthView is shown directly in AuthPickerView )
349350 func withEmailSignIn( ) -> AuthService {
350- return withEmailSignIn { [ weak self] in
351- self ? . navigator. push ( . emailLink)
352- }
353- }
354-
355- /// Enable email sign-in with custom callback
356- func withEmailSignIn( onTap: @escaping ( ) -> Void ) -> AuthService {
357- emailSignInEnabled = true
358- emailSignInCallback = onTap
351+ emailPasswordSignInEnabled = true
359352 return self
360353 }
361354
@@ -392,6 +385,20 @@ public extension AuthService {
392385// MARK: - Email Link Sign In
393386
394387public extension AuthService {
388+ /// Enable email link sign-in with default behavior (navigates to email link view)
389+ func withEmailLinkSignIn( ) -> AuthService {
390+ return withEmailLinkSignIn { [ weak self] in
391+ self ? . navigator. push ( . emailLink)
392+ }
393+ }
394+
395+ /// Enable email link sign-in with custom callback
396+ func withEmailLinkSignIn( onTap: @escaping ( ) -> Void ) -> AuthService {
397+ emailLinkSignInEnabled = true
398+ emailLinkSignInCallback = onTap
399+ return self
400+ }
401+
395402 /// Send email link for sign-in or reauthentication
396403 /// - Parameters:
397404 /// - email: Email address to send link to
0 commit comments