UNPKG

@aws-amplify/auth

Version:
1 lines 6.96 kB
{"version":3,"file":"AuthErrorStrings.mjs","sources":["../../../src/common/AuthErrorStrings.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { AuthValidationErrorCode } from '../errors/types/validation';\nexport const validationErrorMap = {\n [AuthValidationErrorCode.EmptyChallengeResponse]: {\n message: 'challengeResponse is required to confirmSignIn',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordUsername]: {\n message: 'username is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyConfirmSignUpCode]: {\n message: 'code is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyConfirmSignUpUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode]: {\n message: 'confirmationCode is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword]: {\n message: 'newPassword is required to confirmResetPassword',\n },\n [AuthValidationErrorCode.EmptyResendSignUpCodeUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [AuthValidationErrorCode.EmptyResetPasswordUsername]: {\n message: 'username is required to resetPassword',\n },\n [AuthValidationErrorCode.EmptySignInPassword]: {\n message: 'password is required to signIn',\n },\n [AuthValidationErrorCode.EmptySignInUsername]: {\n message: 'username is required to signIn',\n },\n [AuthValidationErrorCode.EmptySignUpPassword]: {\n message: 'password is required to signUp',\n },\n [AuthValidationErrorCode.EmptySignUpUsername]: {\n message: 'username is required to signUp',\n },\n [AuthValidationErrorCode.CustomAuthSignInPassword]: {\n message: 'A password is not needed when signing in with CUSTOM_WITHOUT_SRP',\n recoverySuggestion: 'Do not include a password in your signIn call.',\n },\n [AuthValidationErrorCode.IncorrectMFAMethod]: {\n message: 'Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL',\n recoverySuggestion: 'Try to pass SMS, TOTP, or EMAIL as the challengeResponse',\n },\n [AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {\n message: 'code is required to verifyTotpSetup',\n },\n [AuthValidationErrorCode.EmptyUpdatePassword]: {\n message: 'oldPassword and newPassword are required to changePassword',\n },\n [AuthValidationErrorCode.EmptyConfirmUserAttributeCode]: {\n message: 'confirmation code is required to confirmUserAttribute',\n },\n};\n// TODO: delete this code when the Auth class is removed.\nexport var AuthErrorStrings;\n(function (AuthErrorStrings) {\n AuthErrorStrings[\"DEFAULT_MSG\"] = \"Authentication Error\";\n AuthErrorStrings[\"EMPTY_EMAIL\"] = \"Email cannot be empty\";\n AuthErrorStrings[\"EMPTY_PHONE\"] = \"Phone number cannot be empty\";\n AuthErrorStrings[\"EMPTY_USERNAME\"] = \"Username cannot be empty\";\n AuthErrorStrings[\"INVALID_USERNAME\"] = \"The username should either be a string or one of the sign in types\";\n AuthErrorStrings[\"EMPTY_PASSWORD\"] = \"Password cannot be empty\";\n AuthErrorStrings[\"EMPTY_CODE\"] = \"Confirmation code cannot be empty\";\n AuthErrorStrings[\"SIGN_UP_ERROR\"] = \"Error creating account\";\n AuthErrorStrings[\"NO_MFA\"] = \"No valid MFA method provided\";\n AuthErrorStrings[\"INVALID_MFA\"] = \"Invalid MFA type\";\n AuthErrorStrings[\"EMPTY_CHALLENGE\"] = \"Challenge response cannot be empty\";\n AuthErrorStrings[\"NO_USER_SESSION\"] = \"Failed to get the session because the user is empty\";\n AuthErrorStrings[\"NETWORK_ERROR\"] = \"Network Error\";\n AuthErrorStrings[\"DEVICE_CONFIG\"] = \"Device tracking has not been configured in this User Pool\";\n AuthErrorStrings[\"AUTOSIGNIN_ERROR\"] = \"Please use your credentials to sign in\";\n AuthErrorStrings[\"OAUTH_ERROR\"] = \"Couldn't finish OAuth flow, check your User Pool HostedUI settings\";\n})(AuthErrorStrings || (AuthErrorStrings = {}));\nexport var AuthErrorCodes;\n(function (AuthErrorCodes) {\n AuthErrorCodes[\"SignInException\"] = \"SignInException\";\n AuthErrorCodes[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