Skip to content

Conversation

@russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Nov 10, 2025

  • Email & phone auth buttons are different to the other providers as they push user to different Views but it is currently causing compiler error. This PR fixes this by removing @MainActor from closure parameters in withPhoneSignIn(onTap:) and withEmailSignIn(onTap:) methods because it prevented users from passing closures from non-@MainActor contexts (like init()), while still ensuring main actor execution happens internally where the closures are actually invoked in the UI layer.

So for default Views, it remains the same:

authService = AuthService(
      configuration: configuration
    )
    .withEmailSignIn()
    .withPhoneSignIn()

For custom action on button tap, do this:

authService = AuthService(
      configuration: configuration
    )
    .withEmailSignIn(){
		print("do something")
	}
    .withPhoneSignIn(){
		print("do something")
	}

@russellwheatley russellwheatley changed the title fix: allow user to pass in a closure fix: allow user to pass in a closure for custom action on email and phone auth buttons Nov 10, 2025
@russellwheatley russellwheatley changed the title fix: allow user to pass in a closure for custom action on email and phone auth buttons fix: allow user to pass in a closure for custom action on email link and phone auth buttons Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants