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 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 Nov 10, 2025
@russellwheatley russellwheatley merged commit 793194c into development Nov 12, 2025
8 of 9 checks passed
@russellwheatley russellwheatley deleted the fix-closure branch November 12, 2025 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants