Firebase · api · fg-0187

Firebase Auth returns auth/invalid-credential instead of auth/user-not-found or auth/wrong-password

If you see FirebaseError: Firebase: Error (auth/invalid-credential) for both unknown emails and wrong passwords, the cause and the fix for Firebase are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
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

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun