@@ -36,6 +36,7 @@ export const enum AuthErrorCode {
36
36
CREDENTIAL_MISMATCH = 'custom-token-mismatch' ,
37
37
CREDENTIAL_TOO_OLD_LOGIN_AGAIN = 'requires-recent-login' ,
38
38
DYNAMIC_LINK_NOT_ACTIVATED = 'dynamic-link-not-activated' ,
39
+ EMAIL_CHANGE_NEEDS_VERIFICATION = 'email-change-needs-verification' ,
39
40
EMAIL_EXISTS = 'email-already-in-use' ,
40
41
EXPIRED_OOB_CODE = 'expired-action-code' ,
41
42
EXPIRED_POPUP_REQUEST = 'cancelled-popup-request' ,
@@ -54,6 +55,7 @@ export const enum AuthErrorCode {
54
55
INVALID_EMAIL = 'invalid-email' ,
55
56
INVALID_IDP_RESPONSE = 'invalid-credential' ,
56
57
INVALID_MESSAGE_PAYLOAD = 'invalid-message-payload' ,
58
+ INVALID_MFA_SESSION = 'invalid-multi-factor-session' ,
57
59
INVALID_OAUTH_CLIENT_ID = 'invalid-oauth-client-id' ,
58
60
INVALID_OAUTH_PROVIDER = 'invalid-oauth-provider' ,
59
61
INVALID_OOB_CODE = 'invalid-action-code' ,
@@ -66,6 +68,8 @@ export const enum AuthErrorCode {
66
68
INVALID_SENDER = 'invalid-sender' ,
67
69
INVALID_SESSION_INFO = 'invalid-verification-id' ,
68
70
INVALID_TENANT_ID = 'invalid-tenant-id' ,
71
+ MFA_INFO_NOT_FOUND = 'multi-factor-info-not-found' ,
72
+ MFA_REQUIRED = 'multi-factor-auth-required' ,
69
73
MISSING_ANDROID_PACKAGE_NAME = 'missing-android-pkg-name' ,
70
74
MISSING_APP_CREDENTIAL = 'missing-app-credential' ,
71
75
MISSING_AUTH_DOMAIN = 'auth-domain-config-required' ,
@@ -74,10 +78,11 @@ export const enum AuthErrorCode {
74
78
MISSING_IFRAME_START = 'missing-iframe-start' ,
75
79
MISSING_IOS_BUNDLE_ID = 'missing-ios-bundle-id' ,
76
80
MISSING_OR_INVALID_NONCE = 'missing-or-invalid-nonce' ,
81
+ MISSING_MFA_INFO = 'missing-multi-factor-info' ,
82
+ MISSING_MFA_SESSION = 'missing-multi-factor-session' ,
77
83
MISSING_PHONE_NUMBER = 'missing-phone-number' ,
78
84
MISSING_SESSION_INFO = 'missing-verification-id' ,
79
85
MODULE_DESTROYED = 'app-deleted' ,
80
- MFA_REQUIRED = 'multi-factor-auth-required' ,
81
86
NEED_CONFIRMATION = 'account-exists-with-different-credential' ,
82
87
NETWORK_REQUEST_FAILED = 'network-request-failed' ,
83
88
NULL_USER = 'null-user' ,
@@ -92,13 +97,17 @@ export const enum AuthErrorCode {
92
97
REDIRECT_CANCELLED_BY_USER = 'redirect-cancelled-by-user' ,
93
98
REDIRECT_OPERATION_PENDING = 'redirect-operation-pending' ,
94
99
REJECTED_CREDENTIAL = 'rejected-credential' ,
100
+ SECOND_FACTOR_ALREADY_ENROLLED = 'second-factor-already-in-use' ,
101
+ SECOND_FACTOR_LIMIT_EXCEEDED = 'maximum-second-factor-count-exceeded' ,
95
102
TENANT_ID_MISMATCH = 'tenant-id-mismatch' ,
96
103
TIMEOUT = 'timeout' ,
97
104
TOKEN_EXPIRED = 'user-token-expired' ,
98
105
TOO_MANY_ATTEMPTS_TRY_LATER = 'too-many-requests' ,
99
106
UNAUTHORIZED_DOMAIN = 'unauthorized-continue-uri' ,
107
+ UNSUPPORTED_FIRST_FACTOR = 'unsupported-first-factor' ,
100
108
UNSUPPORTED_PERSISTENCE = 'unsupported-persistence-type' ,
101
109
UNSUPPORTED_TENANT_OPERATION = 'unsupported-tenant-operation' ,
110
+ UNVERIFIED_EMAIL = 'unverified-email' ,
102
111
USER_CANCELLED = 'user-cancelled' ,
103
112
USER_DELETED = 'user-not-found' ,
104
113
USER_DISABLED = 'user-disabled' ,
@@ -139,6 +148,8 @@ const ERRORS: ErrorMap<AuthErrorCode> = {
139
148
[ AuthErrorCode . DYNAMIC_LINK_NOT_ACTIVATED ] :
140
149
'Please activate Dynamic Links in the Firebase Console and agree to the terms and ' +
141
150
'conditions.' ,
151
+ [ AuthErrorCode . EMAIL_CHANGE_NEEDS_VERIFICATION ] :
152
+ 'Multi-factor users must always have a verified email.' ,
142
153
[ AuthErrorCode . EMAIL_EXISTS ] :
143
154
'The email address is already in use by another account.' ,
144
155
[ AuthErrorCode . EXPIRED_OOB_CODE ] : 'The action code has expired.' ,
@@ -180,6 +191,8 @@ const ERRORS: ErrorMap<AuthErrorCode> = {
180
191
[ AuthErrorCode . INVALID_MESSAGE_PAYLOAD ] :
181
192
'The email template corresponding to this action contains invalid characters in its message. ' +
182
193
'Please fix by going to the Auth email templates section in the Firebase Console.' ,
194
+ [ AuthErrorCode . INVALID_MFA_SESSION ] :
195
+ 'The request does not contain a valid proof of first factor successful sign-in.' ,
183
196
[ AuthErrorCode . INVALID_OAUTH_PROVIDER ] :
184
197
'EmailAuthProvider is not supported for this operation. This operation ' +
185
198
'only supports OAuth providers.' ,
@@ -231,12 +244,17 @@ const ERRORS: ErrorMap<AuthErrorCode> = {
231
244
'The request does not contain a valid nonce. This can occur if the ' +
232
245
'SHA-256 hash of the provided raw nonce does not match the hashed nonce ' +
233
246
'in the ID token payload.' ,
247
+ [ AuthErrorCode . MISSING_MFA_INFO ] : 'No second factor identifier is provided.' ,
248
+ [ AuthErrorCode . MISSING_MFA_SESSION ] :
249
+ 'The request is missing proof of first factor successful sign-in.' ,
234
250
[ AuthErrorCode . MISSING_PHONE_NUMBER ] :
235
251
'To send verification codes, provide a phone number for the recipient.' ,
236
252
[ AuthErrorCode . MISSING_SESSION_INFO ] :
237
253
'The phone auth credential was created with an empty verification ID.' ,
238
254
[ AuthErrorCode . MODULE_DESTROYED ] :
239
255
'This instance of FirebaseApp has been deleted.' ,
256
+ [ AuthErrorCode . MFA_INFO_NOT_FOUND ] :
257
+ 'The user does not have a second factor matching the identifier provided.' ,
240
258
[ AuthErrorCode . MFA_REQUIRED ] :
241
259
'Proof of ownership of a second factor is required to complete sign-in.' ,
242
260
[ AuthErrorCode . NEED_CONFIRMATION ] :
@@ -273,6 +291,10 @@ const ERRORS: ErrorMap<AuthErrorCode> = {
273
291
'A redirect sign-in operation is already pending.' ,
274
292
[ AuthErrorCode . REJECTED_CREDENTIAL ] :
275
293
'The request contains malformed or mismatching credentials.' ,
294
+ [ AuthErrorCode . SECOND_FACTOR_ALREADY_ENROLLED ] :
295
+ 'The second factor is already enrolled on this account.' ,
296
+ [ AuthErrorCode . SECOND_FACTOR_LIMIT_EXCEEDED ] :
297
+ 'The maximum allowed number of second factors on a user has been exceeded.' ,
276
298
[ AuthErrorCode . TENANT_ID_MISMATCH ] :
277
299
"The provided tenant ID does not match the Auth instance's tenant ID" ,
278
300
[ AuthErrorCode . TIMEOUT ] : 'The operation has timed out.' ,
@@ -284,10 +306,13 @@ const ERRORS: ErrorMap<AuthErrorCode> = {
284
306
[ AuthErrorCode . UNAUTHORIZED_DOMAIN ] :
285
307
'The domain of the continue URL is not whitelisted. Please whitelist ' +
286
308
'the domain in the Firebase console.' ,
309
+ [ AuthErrorCode . UNSUPPORTED_FIRST_FACTOR ] :
310
+ 'Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.' ,
287
311
[ AuthErrorCode . UNSUPPORTED_PERSISTENCE ] :
288
312
'The current environment does not support the specified persistence type.' ,
289
313
[ AuthErrorCode . UNSUPPORTED_TENANT_OPERATION ] :
290
314
'This operation is not supported in a multi-tenant context.' ,
315
+ [ AuthErrorCode . UNVERIFIED_EMAIL ] : 'The operation requires a verified email.' ,
291
316
[ AuthErrorCode . USER_CANCELLED ] :
292
317
'The user did not grant your application the permissions it requested.' ,
293
318
[ AuthErrorCode . USER_DELETED ] :
0 commit comments