- Symptom
- FirebaseError: Firebase: Error (auth/invalid-credential) for both unknown emails and wrong passwordsfetchSignInMethodsForEmail always returns an empty arrayError handling written for auth/user-not-found never runs
- Cause
- Email enumeration protection hides whether an address is registered, collapsing sign-in failures into INVALID_LOGIN_CREDENTIALS and returning no sign-in methods. It is on by default for projects created on or after September 15, 2023.
- Fix
- Treat auth/invalid-credential as a generic bad email or password message and drop flows that look up sign-in methods by email. Turn protection off only if you accept the enumeration risk.
- Apply
try { await signInWithEmailAndPassword(auth, email, password); } catch (e) { if (e.code === 'auth/invalid-credential') showError('Email or password is incorrect'); else throw e; }- Affected
- Firebase Auth projects created on or after 2023-09-15, and older projects where protection was turned on
- Sources
Last verified 2026-10-15 · Confirmed by 0 builders