Skip to content

Conversation

@Lyokone
Copy link
Contributor

@Lyokone Lyokone commented Jul 24, 2025

This PR removes all deprecated methods from the firebase_auth package in preparation for a breaking change release.

Removed Methods

  • ActionCodeSettings.dynamicLinkDomain - Firebase Dynamic Links is deprecated and will be shut down
  • MicrosoftAuthProvider.credential() - Use signInWithProvider(MicrosoftAuthProvider) instead
  • FirebaseAuth.instanceFor() persistence parameter - Use setPersistence() instead
  • FirebaseAuth.fetchSignInMethodsForEmail() - Removed for security best practices
  • User.updateEmail() - Use verifyBeforeUpdateEmail() instead

Migration Guide

ActionCodeSettings

// Before
ActionCodeSettings(
  url: 'https://example.com',
  dynamicLinkDomain: 'example.page.link',
)

// After
ActionCodeSettings(
  url: 'https://example.com',
  linkDomain: 'your-custom-domain.com', // Use custom Firebase Hosting domain
)

Microsoft Authentication

// Before
final credential = MicrosoftAuthProvider.credential(accessToken);
await FirebaseAuth.instance.signInWithCredential(credential);

// After
final provider = MicrosoftAuthProvider();
await FirebaseAuth.instance.signInWithProvider(provider);

FirebaseAuth Instance

// Before
FirebaseAuth.instanceFor(app: app, persistence: Persistence.local);

// After
final auth = FirebaseAuth.instanceFor(app: app);
auth.setPersistence(Persistence.local);

Email Updates

// Before
await user.updateEmail('[email protected]');

// After
await user.verifyBeforeUpdateEmail('[email protected]');

Email Sign-in Methods

The fetchSignInMethodsForEmail() method has been removed for security reasons. Consider implementing alternative authentication flows that don't require email enumeration.

@Lyokone Lyokone changed the title feat(auth): remove deprecated functions feat(auth)!: remove deprecated functions Jul 24, 2025
@Lyokone Lyokone merged commit d50aad9 into main Jul 25, 2025
35 of 38 checks passed
@Lyokone Lyokone deleted the feat/auth-deprecation branch July 25, 2025 15:13
@firebase firebase locked and limited conversation to collaborators Aug 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants