Description
Operating System
MacOs ventura
Browser Version
Chrome 117.0.5938.88
Firebase SDK Version
^10.4.0
Firebase SDK Product:
Auth
Describe your project's tooling
I am using the firebase auth service for a login page. I enabled the "email enumeration protection" and I want to display a specific message when the error INVALID_LOGIN_CREDENTIALS (the code is auth/invalid-login-credentials) occurs.
For this I need to check if the received error is indeed INVALID_LOGIN_CREDENTIALS. Consequently, I am looking for the official error in the firebase repository.
Describe the problem
My problem is that I cannot find the error INVALID_LOGIN_CREDENTIALS in the AuthErrorCodes (in the file auth-public.d.ts ) enumeration that should contain all auth errors. This enumeration is described as:
a map of potential
Auth
error codes, for easier comparison with errors thrown by the SDK
But this error is not in it. It seems that it was not included in the official documentation of errors either.
This is the error that my browser receives which proves that it is sent by firebase:
FirebaseError: Firebase: Error (auth/invalid-login-credentials).
at createErrorInternal (assert.ts:136:55)
at _fail (assert.ts:65:9)
at _performFetchWithErrorHandling (index.ts:196:9)
at async _performSignInRequest (index.ts:217:27)
at async _signInWithCredential (credential.ts:37:20)
In my opinion the missing line in AuthErrorCodes is this one:
readonly INVALID_LOGIN_CREDENTIALS = "auth/invalid-login-credentials";
Since I cannot find the error I am currently putting it in a constant:
export const INVALID_LOGIN_CREDENTIALS = 'auth/invalid-login-credentials';
Am I looking in the wrong place? Or is the error really not available in the library? If it is option 2, then it should definitely be added!
Steps and code to reproduce issue
What I'm doing
Set up a project that uses the firebase auth service for a login page.
Enable the email enumeration protection.
Try to display a message specific to the INVALID_LOGIN_CREDENTIALS error (with the error code auth/invalid-login-credentials).
What I actually need
Find a reference to the INVALID_LOGIN_CREDENTIALS error (with the error code auth/invalid-login-credentials) in the repository that can be used in any app.
Basically, make this work:
import { AuthErrorCodes } from 'firebase/auth';
const iNeedThisErrorSomewhere = AuthErrorCodes.INVALID_LOGIN_CREDENTIALS;