Skip to content

Conversation

@russellwheatley
Copy link
Member

@russellwheatley russellwheatley commented Nov 6, 2025

Type Safety Improvements

  • Introduced CredentialAuthProviderSwift protocol to distinguish credential-based providers from other auth flows
  • Provider initializers now accept concrete types (e.g., GoogleProviderSwift) instead of generic protocols
  • Eliminated force-casting throughout the codebase

Phone Auth Simplification

  • Removed PhoneAuthProviderSwift protocol - phone verification logic now handled internally by AuthService
  • Simplified phone auth button initialization (no longer requires provider parameter)
  • Phone reauthentication now explicitly requires sign-out/sign-in flow

@demolaf - not possible to move phone auth methods out of auth service package because the methods are used in the Views of this package.

@russellwheatley russellwheatley marked this pull request as ready for review November 6, 2025 11:01
} else if providerId == PhoneAuthProviderID {
// Phone auth requires manual reauthentication via sign out and sign in otherwise it will take
// the user out of the existing flow
throw AuthServiceError.reauthenticationRequired(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@demolaf - one of the reasons why I liked phone auth being a separate flow is because now when the user needs to reauthenticate for sensitive operations (e.g. changing password), we have to throw error asking the user to sign-out and sign back in again because pushing user to enter phone number will clear the View they're in already and state would be lost.

Copy link
Member

@demolaf demolaf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@russellwheatley russellwheatley merged commit 859e364 into development Nov 6, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants