@@ -25,8 +25,6 @@ import { AuthCredential } from './credentials';
25
25
26
26
/**
27
27
* Enumeration of Firebase Auth error codes.
28
- *
29
- * @public
30
28
*/
31
29
export const enum AuthErrorCode {
32
30
ADMIN_ONLY_OPERATION = 'admin-restricted-operation' ,
@@ -433,3 +431,112 @@ export const _DEFAULT_AUTH_ERROR_FACTORY = new ErrorFactory<
433
431
AuthErrorCode ,
434
432
AuthErrorParams
435
433
> ( 'auth' , 'Firebase' , _prodErrorMap ( ) ) ;
434
+
435
+ /**
436
+ * A map of potential Auth error codes, for easier comparison with errors
437
+ * thrown by the SDK.
438
+ *
439
+ * @remarks
440
+ * Note that you can't tree-shake individual keys
441
+ * in the map, so by using the map you might substantially increase your
442
+ * bundle size.
443
+ *
444
+ * @public
445
+ */
446
+ export const AUTH_ERROR_CODES_MAP_DO_NOT_USE_INTERNALLY = {
447
+ ADMIN_ONLY_OPERATION : 'auth/admin-restricted-operation' ,
448
+ ARGUMENT_ERROR : 'auth/argument-error' ,
449
+ APP_NOT_AUTHORIZED : 'auth/app-not-authorized' ,
450
+ APP_NOT_INSTALLED : 'auth/app-not-installed' ,
451
+ CAPTCHA_CHECK_FAILED : 'auth/captcha-check-failed' ,
452
+ CODE_EXPIRED : 'auth/code-expired' ,
453
+ CORDOVA_NOT_READY : 'auth/cordova-not-ready' ,
454
+ CORS_UNSUPPORTED : 'auth/cors-unsupported' ,
455
+ CREDENTIAL_ALREADY_IN_USE : 'auth/credential-already-in-use' ,
456
+ CREDENTIAL_MISMATCH : 'auth/custom-token-mismatch' ,
457
+ CREDENTIAL_TOO_OLD_LOGIN_AGAIN : 'auth/requires-recent-login' ,
458
+ DEPENDENT_SDK_INIT_BEFORE_AUTH : 'auth/dependent-sdk-initialized-before-auth' ,
459
+ DYNAMIC_LINK_NOT_ACTIVATED : 'auth/dynamic-link-not-activated' ,
460
+ EMAIL_CHANGE_NEEDS_VERIFICATION : 'auth/email-change-needs-verification' ,
461
+ EMAIL_EXISTS : 'auth/email-already-in-use' ,
462
+ EMULATOR_CONFIG_FAILED : 'auth/emulator-config-failed' ,
463
+ EXPIRED_OOB_CODE : 'auth/expired-action-code' ,
464
+ EXPIRED_POPUP_REQUEST : 'auth/cancelled-popup-request' ,
465
+ INTERNAL_ERROR : 'auth/internal-error' ,
466
+ INVALID_API_KEY : 'auth/invalid-api-key' ,
467
+ INVALID_APP_CREDENTIAL : 'auth/invalid-app-credential' ,
468
+ INVALID_APP_ID : 'auth/invalid-app-id' ,
469
+ INVALID_AUTH : 'auth/invalid-user-token' ,
470
+ INVALID_AUTH_EVENT : 'auth/invalid-auth-event' ,
471
+ INVALID_CERT_HASH : 'auth/invalid-cert-hash' ,
472
+ INVALID_CODE : 'auth/invalid-verification-code' ,
473
+ INVALID_CONTINUE_URI : 'auth/invalid-continue-uri' ,
474
+ INVALID_CORDOVA_CONFIGURATION : 'auth/invalid-cordova-configuration' ,
475
+ INVALID_CUSTOM_TOKEN : 'auth/invalid-custom-token' ,
476
+ INVALID_DYNAMIC_LINK_DOMAIN : 'auth/invalid-dynamic-link-domain' ,
477
+ INVALID_EMAIL : 'auth/invalid-email' ,
478
+ INVALID_EMULATOR_SCHEME : 'auth/invalid-emulator-scheme' ,
479
+ INVALID_IDP_RESPONSE : 'auth/invalid-credential' ,
480
+ INVALID_MESSAGE_PAYLOAD : 'auth/invalid-message-payload' ,
481
+ INVALID_MFA_SESSION : 'auth/invalid-multi-factor-session' ,
482
+ INVALID_OAUTH_CLIENT_ID : 'auth/invalid-oauth-client-id' ,
483
+ INVALID_OAUTH_PROVIDER : 'auth/invalid-oauth-provider' ,
484
+ INVALID_OOB_CODE : 'auth/invalid-action-code' ,
485
+ INVALID_ORIGIN : 'auth/unauthorized-domain' ,
486
+ INVALID_PASSWORD : 'auth/wrong-password' ,
487
+ INVALID_PERSISTENCE : 'auth/invalid-persistence-type' ,
488
+ INVALID_PHONE_NUMBER : 'auth/invalid-phone-number' ,
489
+ INVALID_PROVIDER_ID : 'auth/invalid-provider-id' ,
490
+ INVALID_RECIPIENT_EMAIL : 'auth/invalid-recipient-email' ,
491
+ INVALID_SENDER : 'auth/invalid-sender' ,
492
+ INVALID_SESSION_INFO : 'auth/invalid-verification-id' ,
493
+ INVALID_TENANT_ID : 'auth/invalid-tenant-id' ,
494
+ MFA_INFO_NOT_FOUND : 'auth/multi-factor-info-not-found' ,
495
+ MFA_REQUIRED : 'auth/multi-factor-auth-required' ,
496
+ MISSING_ANDROID_PACKAGE_NAME : 'auth/missing-android-pkg-name' ,
497
+ MISSING_APP_CREDENTIAL : 'auth/missing-app-credential' ,
498
+ MISSING_AUTH_DOMAIN : 'auth/auth-domain-config-required' ,
499
+ MISSING_CODE : 'auth/missing-verification-code' ,
500
+ MISSING_CONTINUE_URI : 'auth/missing-continue-uri' ,
501
+ MISSING_IFRAME_START : 'auth/missing-iframe-start' ,
502
+ MISSING_IOS_BUNDLE_ID : 'auth/missing-ios-bundle-id' ,
503
+ MISSING_OR_INVALID_NONCE : 'auth/missing-or-invalid-nonce' ,
504
+ MISSING_MFA_INFO : 'auth/missing-multi-factor-info' ,
505
+ MISSING_MFA_SESSION : 'auth/missing-multi-factor-session' ,
506
+ MISSING_PHONE_NUMBER : 'auth/missing-phone-number' ,
507
+ MISSING_SESSION_INFO : 'auth/missing-verification-id' ,
508
+ MODULE_DESTROYED : 'auth/app-deleted' ,
509
+ NEED_CONFIRMATION : 'auth/account-exists-with-different-credential' ,
510
+ NETWORK_REQUEST_FAILED : 'auth/network-request-failed' ,
511
+ NULL_USER : 'auth/null-user' ,
512
+ NO_AUTH_EVENT : 'auth/no-auth-event' ,
513
+ NO_SUCH_PROVIDER : 'auth/no-such-provider' ,
514
+ OPERATION_NOT_ALLOWED : 'auth/operation-not-allowed' ,
515
+ OPERATION_NOT_SUPPORTED : 'auth/operation-not-supported-in-this-environment' ,
516
+ POPUP_BLOCKED : 'auth/popup-blocked' ,
517
+ POPUP_CLOSED_BY_USER : 'auth/popup-closed-by-user' ,
518
+ PROVIDER_ALREADY_LINKED : 'auth/provider-already-linked' ,
519
+ QUOTA_EXCEEDED : 'auth/quota-exceeded' ,
520
+ REDIRECT_CANCELLED_BY_USER : 'auth/redirect-cancelled-by-user' ,
521
+ REDIRECT_OPERATION_PENDING : 'auth/redirect-operation-pending' ,
522
+ REJECTED_CREDENTIAL : 'auth/rejected-credential' ,
523
+ SECOND_FACTOR_ALREADY_ENROLLED : 'auth/second-factor-already-in-use' ,
524
+ SECOND_FACTOR_LIMIT_EXCEEDED : 'auth/maximum-second-factor-count-exceeded' ,
525
+ TENANT_ID_MISMATCH : 'auth/tenant-id-mismatch' ,
526
+ TIMEOUT : 'auth/timeout' ,
527
+ TOKEN_EXPIRED : 'auth/user-token-expired' ,
528
+ TOO_MANY_ATTEMPTS_TRY_LATER : 'auth/too-many-requests' ,
529
+ UNAUTHORIZED_DOMAIN : 'auth/unauthorized-continue-uri' ,
530
+ UNSUPPORTED_FIRST_FACTOR : 'auth/unsupported-first-factor' ,
531
+ UNSUPPORTED_PERSISTENCE : 'auth/unsupported-persistence-type' ,
532
+ UNSUPPORTED_TENANT_OPERATION : 'auth/unsupported-tenant-operation' ,
533
+ UNVERIFIED_EMAIL : 'auth/unverified-email' ,
534
+ USER_CANCELLED : 'auth/user-cancelled' ,
535
+ USER_DELETED : 'auth/user-not-found' ,
536
+ USER_DISABLED : 'auth/user-disabled' ,
537
+ USER_MISMATCH : 'auth/user-mismatch' ,
538
+ USER_SIGNED_OUT : 'auth/user-signed-out' ,
539
+ WEAK_PASSWORD : 'auth/weak-password' ,
540
+ WEB_STORAGE_UNSUPPORTED : 'auth/web-storage-unsupported' ,
541
+ ALREADY_INITIALIZED : 'auth/already-initialized'
542
+ } as const ;
0 commit comments