Skip to content

Commit c6e9ef7

Browse files
fix: adds missing EMAIL_NOT_FOUND error code (#1246)
Catch `EMAIL_NOT_FOUND` and translate to `auth/email-not-found` when `/accounts:sendOobCode` is called for password reset on a user that does not exist. Fixes #1202
1 parent be4ebc6 commit c6e9ef7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/utils/error.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ export class AuthClientErrorCode {
374374
code: 'email-already-exists',
375375
message: 'The email address is already in use by another account.',
376376
};
377+
public static EMAIL_NOT_FOUND = {
378+
code: 'email-not-found',
379+
message: 'There is no user record corresponding to the provided email.',
380+
};
377381
public static FORBIDDEN_CLAIM = {
378382
code: 'reserved-claim',
379383
message: 'The specified developer claim is reserved and cannot be specified.',
@@ -854,6 +858,8 @@ const AUTH_SERVER_TO_CLIENT_CODE: ServerToClientCode = {
854858
DUPLICATE_MFA_ENROLLMENT_ID: 'SECOND_FACTOR_UID_ALREADY_EXISTS',
855859
// setAccountInfo email already exists.
856860
EMAIL_EXISTS: 'EMAIL_ALREADY_EXISTS',
861+
// /accounts:sendOobCode for password reset when user is not found.
862+
EMAIL_NOT_FOUND: 'EMAIL_NOT_FOUND',
857863
// Reserved claim name.
858864
FORBIDDEN_CLAIM: 'FORBIDDEN_CLAIM',
859865
// Invalid claims provided.

0 commit comments

Comments
 (0)