getAuthErrorMessage method

String getAuthErrorMessage(
  1. FirebaseAuthException e
)

Maps any FirebaseAuthException code to a user-friendly message.

Implementation

String getAuthErrorMessage(FirebaseAuthException e) => switch (e.code) {
  'user-not-found' => 'No account found with this email',
  'wrong-password' => 'Incorrect password',
  'invalid-email' => 'Please enter a valid email address',
  'user-disabled' => 'This account has been disabled',
  'email-already-in-use' => 'This email is already registered',
  'weak-password' => 'Password should be at least 6 characters',
  'network-request-failed' => 'Check your internet connection',
  'too-many-requests' => 'Too many attempts. Please try again later',
  'requires-recent-login' => 'Session expired. Please sign in again',
  _ => e.message ?? 'An unexpected error occurred',
};