@aws-amplify/auth 6.4.3-unstable.fab71a7.0 → 6.5.1-email-mfa-test.4e655bc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/common/AuthErrorStrings.js +2 -2
  2. package/dist/cjs/common/AuthErrorStrings.js.map +1 -1
  3. package/dist/cjs/providers/cognito/apis/confirmSignIn.js +2 -2
  4. package/dist/cjs/providers/cognito/apis/confirmSignIn.js.map +1 -1
  5. package/dist/cjs/providers/cognito/apis/updateMFAPreference.js +2 -1
  6. package/dist/cjs/providers/cognito/apis/updateMFAPreference.js.map +1 -1
  7. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdStore.js +7 -1
  8. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdStore.js.map +1 -1
  9. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.js +3 -1
  10. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.js.map +1 -1
  11. package/dist/cjs/providers/cognito/utils/signInHelpers.js +183 -130
  12. package/dist/cjs/providers/cognito/utils/signInHelpers.js.map +1 -1
  13. package/dist/esm/common/AuthErrorStrings.mjs +2 -2
  14. package/dist/esm/common/AuthErrorStrings.mjs.map +1 -1
  15. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/types/sdk.d.ts +24 -3
  16. package/dist/esm/providers/cognito/apis/confirmSignIn.mjs +2 -2
  17. package/dist/esm/providers/cognito/apis/confirmSignIn.mjs.map +1 -1
  18. package/dist/esm/providers/cognito/apis/updateMFAPreference.mjs +2 -1
  19. package/dist/esm/providers/cognito/apis/updateMFAPreference.mjs.map +1 -1
  20. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.d.ts +1 -0
  21. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs +7 -1
  22. package/dist/esm/providers/cognito/credentialsProvider/IdentityIdStore.mjs.map +1 -1
  23. package/dist/esm/providers/cognito/types/inputs.d.ts +1 -0
  24. package/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs +3 -1
  25. package/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs.map +1 -1
  26. package/dist/esm/providers/cognito/utils/signInHelpers.d.ts +4 -3
  27. package/dist/esm/providers/cognito/utils/signInHelpers.mjs +181 -127
  28. package/dist/esm/providers/cognito/utils/signInHelpers.mjs.map +1 -1
  29. package/dist/esm/types/models.d.ts +44 -2
  30. package/package.json +5 -5
  31. package/src/common/AuthErrorStrings.ts +4 -2
  32. package/src/foundation/factories/serviceClients/cognitoIdentityProvider/types/sdk.ts +23 -1
  33. package/src/providers/cognito/apis/confirmSignIn.ts +2 -2
  34. package/src/providers/cognito/apis/updateMFAPreference.ts +2 -1
  35. package/src/providers/cognito/credentialsProvider/IdentityIdStore.ts +10 -1
  36. package/src/providers/cognito/types/inputs.ts +1 -0
  37. package/src/providers/cognito/utils/oauth/getRedirectUrl.ts +1 -0
  38. package/src/providers/cognito/utils/signInHelpers.ts +240 -166
  39. package/src/types/models.ts +48 -1
@@ -47,8 +47,8 @@ exports.validationErrorMap = {
47
47
  recoverySuggestion: 'Do not include a password in your signIn call.',
48
48
  },
49
49
  [validation_1.AuthValidationErrorCode.IncorrectMFAMethod]: {
50
- message: 'Incorrect MFA method was chosen. It should be either SMS or TOTP',
51
- recoverySuggestion: 'Try to pass TOTP or SMS as the challengeResponse',
50
+ message: 'Incorrect MFA method was chosen. It should be either SMS, TOTP, or EMAIL',
51
+ recoverySuggestion: 'Try to pass SMS, TOTP, or EMAIL as the challengeResponse',
52
52
  },
53
53
  [validation_1.AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {
54
54
  message: 'code is required to verifyTotpSetup',
@@ -1 +1 @@
1
- {"version":3,"file":"AuthErrorStrings.js","sources":["../../../src/common/AuthErrorStrings.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthErrorCodes = exports.AuthErrorStrings = exports.validationErrorMap = void 0;\nconst validation_1 = require(\"../errors/types/validation\");\nexports.validationErrorMap = {\n [validation_1.AuthValidationErrorCode.EmptyChallengeResponse]: {\n message: 'challengeResponse is required to confirmSignIn',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordUsername]: {\n message: 'username is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmSignUpCode]: {\n message: 'code is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmSignUpUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode]: {\n message: 'confirmationCode is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword]: {\n message: 'newPassword is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyResendSignUpCodeUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyResetPasswordUsername]: {\n message: 'username is required to resetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptySignInPassword]: {\n message: 'password is required to signIn',\n },\n [validation_1.AuthValidationErrorCode.EmptySignInUsername]: {\n message: 'username is required to signIn',\n },\n [validation_1.AuthValidationErrorCode.EmptySignUpPassword]: {\n message: 'password is required to signUp',\n },\n [validation_1.AuthValidationErrorCode.EmptySignUpUsername]: {\n message: 'username is required to signUp',\n },\n [validation_1.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 [validation_1.AuthValidationErrorCode.IncorrectMFAMethod]: {\n message: 'Incorrect MFA method was chosen. It should be either SMS or TOTP',\n recoverySuggestion: 'Try to pass TOTP or SMS as the challengeResponse',\n },\n [validation_1.AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {\n message: 'code is required to verifyTotpSetup',\n },\n [validation_1.AuthValidationErrorCode.EmptyUpdatePassword]: {\n message: 'oldPassword and newPassword are required to changePassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmUserAttributeCode]: {\n message: 'confirmation code is required to confirmUserAttribute',\n },\n};\n// TODO: delete this code when the Auth class is removed.\nvar 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 = exports.AuthErrorStrings || (exports.AuthErrorStrings = {}));\nvar AuthErrorCodes;\n(function (AuthErrorCodes) {\n AuthErrorCodes[\"SignInException\"] = \"SignInException\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yright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AuthErrorCodes = exports.AuthErrorStrings = exports.validationErrorMap = void 0;\nconst validation_1 = require(\"../errors/types/validation\");\nexports.validationErrorMap = {\n [validation_1.AuthValidationErrorCode.EmptyChallengeResponse]: {\n message: 'challengeResponse is required to confirmSignIn',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordUsername]: {\n message: 'username is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmSignUpCode]: {\n message: 'code is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmSignUpUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode]: {\n message: 'confirmationCode is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword]: {\n message: 'newPassword is required to confirmResetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyResendSignUpCodeUsername]: {\n message: 'username is required to confirmSignUp',\n },\n [validation_1.AuthValidationErrorCode.EmptyResetPasswordUsername]: {\n message: 'username is required to resetPassword',\n },\n [validation_1.AuthValidationErrorCode.EmptySignInPassword]: {\n message: 'password is required to signIn',\n },\n [validation_1.AuthValidationErrorCode.EmptySignInUsername]: {\n message: 'username is required to signIn',\n },\n [validation_1.AuthValidationErrorCode.EmptySignUpPassword]: {\n message: 'password is required to signUp',\n },\n [validation_1.AuthValidationErrorCode.EmptySignUpUsername]: {\n message: 'username is required to signUp',\n },\n [validation_1.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 [validation_1.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 [validation_1.AuthValidationErrorCode.EmptyVerifyTOTPSetupCode]: {\n message: 'code is required to verifyTotpSetup',\n },\n [validation_1.AuthValidationErrorCode.EmptyUpdatePassword]: {\n message: 'oldPassword and newPassword are required to changePassword',\n },\n [validation_1.AuthValidationErrorCode.EmptyConfirmUserAttributeCode]: {\n message: 'confirmation code is required to confirmUserAttribute',\n },\n};\n// TODO: delete this code when the Auth class is removed.\nvar 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 = exports.AuthErrorStrings || (exports.AuthErrorStrings = {}));\nvar AuthErrorCodes;\n(function (AuthErrorCodes) {\n AuthErrorCodes[\"SignInException\"] = \"SignInException\";\n AuthErrorCodes[\"OAuthSignInError\"] = \"OAuthSignInException\";\n})(AuthErrorCodes = exports.AuthErrorCodes || (exports.AuthErrorCodes = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,GAAG,KAAK,CAAC,CAAC;AACxF,MAAM,YAAY,GAAG,OAAO,CAAC,4BAA4B,CAAC,CAAC;AAC3D,OAAO,CAAC,kBAAkB,GAAG;AAC7B,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,sBAAsB,GAAG;AACnE,QAAQ,OAAO,EAAE,gDAAgD;AACjE,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,iCAAiC,GAAG;AAC9E,QAAQ,OAAO,EAAE,8CAA8C;AAC/D,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,sBAAsB,GAAG;AACnE,QAAQ,OAAO,EAAE,mCAAmC;AACpD,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,0BAA0B,GAAG;AACvE,QAAQ,OAAO,EAAE,uCAAuC;AACxD,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,yCAAyC,GAAG;AACtF,QAAQ,OAAO,EAAE,sDAAsD;AACvE,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,oCAAoC,GAAG;AACjF,QAAQ,OAAO,EAAE,iDAAiD;AAClE,KAAK;AACL,IAAI,CAAC,YAAY,CAAC,uBAAuB,CAAC,6BAA6B,GAAG;AAC1E,QAAQ,OAAO,EAAE,uCAAuC;AACxD,KAAK;AACL,IAAI,CAAC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@ async function confirmSignIn(input) {
43
43
  throw new AuthError_1.AuthError({
44
44
  name: AuthErrorStrings_1.AuthErrorCodes.SignInException,
45
45
  message: `
46
- An error occurred during the sign in process.
47
-
46
+ An error occurred during the sign in process.
47
+
48
48
  This most likely occurred due to:
49
49
  1. signIn was not called before confirmSignIn.
50
50
  2. signIn threw an exception.
@@ -1 +1 @@
1
- {"version":3,"file":"confirmSignIn.js","sources":["../../../../../src/providers/cognito/apis/confirmSignIn.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.confirmSignIn = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst signInStore_1 = require(\"../utils/signInStore\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst signInHelpers_1 = require(\"../utils/signInHelpers\");\nconst assertServiceError_1 = require(\"../../../errors/utils/assertServiceError\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst AuthErrorStrings_1 = require(\"../../../common/AuthErrorStrings\");\nconst cacheTokens_1 = require(\"../tokenProvider/cacheTokens\");\nconst tokenProvider_1 = require(\"../tokenProvider\");\nconst dispatchSignedInHubEvent_1 = require(\"../utils/dispatchSignedInHubEvent\");\n/**\n * Continues or completes the sign in process when required by the initial call to `signIn`.\n *\n * @param input - The ConfirmSignInInput object\n * @returns ConfirmSignInOutput\n * @throws -{@link VerifySoftwareTokenException }:\n * Thrown due to an invalid MFA token.\n * @throws -{@link RespondToAuthChallengeException }:\n * Thrown due to an invalid auth challenge response.\n * @throws -{@link AssociateSoftwareTokenException}:\n * Thrown due to a service error during the MFA setup process.\n * @throws -{@link AuthValidationErrorCode }:\n * Thrown when `challengeResponse` is not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignIn(input) {\n const { challengeResponse, options } = input;\n const { username, challengeName, signInSession, signInDetails } = signInStore_1.signInStore.getState();\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const clientMetaData = options?.clientMetadata;\n (0, assertValidationError_1.assertValidationError)(!!challengeResponse, validation_1.AuthValidationErrorCode.EmptyChallengeResponse);\n if (!username || !challengeName || !signInSession)\n // TODO: remove this error message for production apps\n throw new AuthError_1.AuthError({\n name: AuthErrorStrings_1.AuthErrorCodes.SignInException,\n message: `\n\t\t\tAn error occurred during the sign in process. \n\t\t\t\n\t\t\tThis most likely occurred due to:\n\t\t\t1. signIn was not called before confirmSignIn.\n\t\t\t2. signIn threw an exception.\n\t\t\t3. page was refreshed during the sign in flow.\n\t\t\t`,\n recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n 'and that the page is not refreshed until the sign in process is done.',\n });\n try {\n const { Session, ChallengeName: handledChallengeName, AuthenticationResult, ChallengeParameters: handledChallengeParameters, } = await (0, signInHelpers_1.handleChallengeName)(username, challengeName, signInSession, challengeResponse, authConfig, tokenProvider_1.tokenOrchestrator, clientMetaData, options);\n // sets up local state used during the sign-in process\n (0, signInStore_1.setActiveSignInState)({\n signInSession: Session,\n username,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n (0, signInStore_1.cleanActiveSignInState)();\n await (0, cacheTokens_1.cacheCognitoTokens)({\n username,\n ...AuthenticationResult,\n NewDeviceMetadata: await (0, signInHelpers_1.getNewDeviceMetadata)({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n await (0, dispatchSignedInHubEvent_1.dispatchSignedInHubEvent)();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return (0, signInHelpers_1.getSignInResult)({\n challengeName: handledChallengeName,\n challengeParameters: handledChallengeParameters,\n });\n }\n catch (error) {\n (0, assertServiceError_1.assertServiceError)(error);\n const result = (0, signInHelpers_1.getSignInResultFromError)(error.name);\n if (result)\n return result;\n throw error;\n }\n}\nexports.confirmSignIn = confirmSignIn;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AACzD,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAC1D,MAAM,oBAAoB,GAAG,OAAO,CAAC,0CAA0C,CAAC,CAAC;AACjF,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC,CAAC;AACvF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACjE,MAAM,kBAAkB,GAAG,OAAO,CAAC,kCAAkC,CAAC,CAAC;AACvE,MAAM,aAAa,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC9D,MAAM,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;AACpD,MAAM,0BAA0B,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAChF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,aAAa,CAAC,KAAK,EAAE;AACpC,IAAI,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;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MAAM,KAAK,CAAC;AACpB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
1
+ {"version":3,"file":"confirmSignIn.js","sources":["../../../../../src/providers/cognito/apis/confirmSignIn.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.confirmSignIn = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst signInStore_1 = require(\"../utils/signInStore\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst signInHelpers_1 = require(\"../utils/signInHelpers\");\nconst assertServiceError_1 = require(\"../../../errors/utils/assertServiceError\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst AuthErrorStrings_1 = require(\"../../../common/AuthErrorStrings\");\nconst cacheTokens_1 = require(\"../tokenProvider/cacheTokens\");\nconst tokenProvider_1 = require(\"../tokenProvider\");\nconst dispatchSignedInHubEvent_1 = require(\"../utils/dispatchSignedInHubEvent\");\n/**\n * Continues or completes the sign in process when required by the initial call to `signIn`.\n *\n * @param input - The ConfirmSignInInput object\n * @returns ConfirmSignInOutput\n * @throws -{@link VerifySoftwareTokenException }:\n * Thrown due to an invalid MFA token.\n * @throws -{@link RespondToAuthChallengeException }:\n * Thrown due to an invalid auth challenge response.\n * @throws -{@link AssociateSoftwareTokenException}:\n * Thrown due to a service error during the MFA setup process.\n * @throws -{@link AuthValidationErrorCode }:\n * Thrown when `challengeResponse` is not defined.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmSignIn(input) {\n const { challengeResponse, options } = input;\n const { username, challengeName, signInSession, signInDetails } = signInStore_1.signInStore.getState();\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const clientMetaData = options?.clientMetadata;\n (0, assertValidationError_1.assertValidationError)(!!challengeResponse, validation_1.AuthValidationErrorCode.EmptyChallengeResponse);\n if (!username || !challengeName || !signInSession)\n // TODO: remove this error message for production apps\n throw new AuthError_1.AuthError({\n name: AuthErrorStrings_1.AuthErrorCodes.SignInException,\n message: `\n\t\t\tAn error occurred during the sign in process.\n\n\t\t\tThis most likely occurred due to:\n\t\t\t1. signIn was not called before confirmSignIn.\n\t\t\t2. signIn threw an exception.\n\t\t\t3. page was refreshed during the sign in flow.\n\t\t\t`,\n recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n 'and that the page is not refreshed until the sign in process is done.',\n });\n try {\n const { Session, ChallengeName: handledChallengeName, AuthenticationResult, ChallengeParameters: handledChallengeParameters, } = await (0, signInHelpers_1.handleChallengeName)(username, challengeName, signInSession, challengeResponse, authConfig, tokenProvider_1.tokenOrchestrator, clientMetaData, options);\n // sets up local state used during the sign-in process\n (0, signInStore_1.setActiveSignInState)({\n signInSession: Session,\n username,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n (0, signInStore_1.cleanActiveSignInState)();\n await (0, cacheTokens_1.cacheCognitoTokens)({\n username,\n ...AuthenticationResult,\n NewDeviceMetadata: await (0, signInHelpers_1.getNewDeviceMetadata)({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n await (0, dispatchSignedInHubEvent_1.dispatchSignedInHubEvent)();\n return {\n isSignedIn: true,\n nextStep: { signInStep: 'DONE' },\n };\n }\n return (0, signInHelpers_1.getSignInResult)({\n challengeName: handledChallengeName,\n challengeParameters: handledChallengeParameters,\n });\n }\n catch (error) {\n (0, assertServiceError_1.assertServiceError)(error);\n const result = (0, signInHelpers_1.getSignInResultFromError)(error.name);\n if (result)\n return result;\n throw error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AAY,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,kBAAkB,EAAE;AACxD,gBAAgB,QAAQ;AACxB,gBAAgB,GAAG,oBAAoB;AACvC,gBAAgB,iBAAiB,EAAE,MAAM,CAAC,CAAC,EAAE,eAAe,CAAC,oBAAoB,EAAE;AACnF,oBAAoB,UAAU,EAAE,UAAU,CAAC,UAAU;AACrD,oBAAoB,gBAAgB,EAAE,UAAU,CAAC,gBAAgB;AACjE,oBAAoB,iBAAiB,EAAE,oBAAoB,CAAC,iBAAiB;AAC7E,oBAAoB,WAAW,EAAE,oBAAoB,CAAC,WAAW;AACjE,iBAAiB,CAAC;AAClB,gBAAgB,aAAa;AAC7B,aAAa,CAAC,CAAC;AACf,YAAY,MAAM,CAAC,CAAC,EAAE,0BAA0B,CAAC,wBAAwB,GAAG,CAAC;AAC7E,YAAY,OAAO;AACnB,gBAAgB,UAAU,EAAE,IAAI;AAChC,gBAAgB,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;AAChD,aAAa,CAAC;AACd,SAAS;AACT,QAAQ,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,eAAe,EAAE;AACpD,YAAY,aAAa,EAAE,oBAAoB;AAC/C,YAAY,mBAAmB,EAAE,0BAA0B;AAC3D,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;AAC5D,QAAQ,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,wBAAwB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;AACjF,QAAQ,IAAI,MAAM;AAClB,YAAY,OAAO,MAAM,CAAC;AAC1B,QAAQ,MAAM,KAAK,CAAC;AACpB,KAAK;AACL,CAAC;AACD,OAAO,CAAC,aAAa,GAAG,aAAa;;"}
@@ -19,7 +19,7 @@ const factories_1 = require("../factories");
19
19
  * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.
20
20
  */
21
21
  async function updateMFAPreference(input) {
22
- const { sms, totp } = input;
22
+ const { sms, totp, email } = input;
23
23
  const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;
24
24
  (0, utils_1.assertTokenProviderConfig)(authConfig);
25
25
  const { userPoolEndpoint, userPoolId } = authConfig;
@@ -37,6 +37,7 @@ async function updateMFAPreference(input) {
37
37
  AccessToken: tokens.accessToken.toString(),
38
38
  SMSMfaSettings: getMFASettings(sms),
39
39
  SoftwareTokenMfaSettings: getMFASettings(totp),
40
+ EmailMfaSettings: getMFASettings(email),
40
41
  });
41
42
  }
42
43
  exports.updateMFAPreference = updateMFAPreference;
@@ -1 +1 @@
1
- {"version":3,"file":"updateMFAPreference.js","sources":["../../../../../src/providers/cognito/apis/updateMFAPreference.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getMFASettings = exports.updateMFAPreference = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\nconst types_1 = require(\"../utils/types\");\nconst utils_2 = require(\"../../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../../../foundation/factories/serviceClients/cognitoIdentityProvider\");\nconst factories_1 = require(\"../factories\");\n/**\n * Updates the MFA preference of the user.\n *\n * @param input - The UpdateMFAPreferenceInput object.\n * @throws -{@link SetUserMFAPreferenceException } - Service error thrown when the MFA preference cannot be updated.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function updateMFAPreference(input) {\n const { sms, totp } = input;\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await (0, core_1.fetchAuthSession)({ forceRefresh: false });\n (0, types_1.assertAuthTokens)(tokens);\n const setUserMFAPreference = (0, cognitoIdentityProvider_1.createSetUserMFAPreferenceClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await setUserMFAPreference({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.UpdateMFAPreference),\n }, {\n AccessToken: tokens.accessToken.toString(),\n SMSMfaSettings: getMFASettings(sms),\n SoftwareTokenMfaSettings: getMFASettings(totp),\n });\n}\nexports.updateMFAPreference = updateMFAPreference;\nfunction getMFASettings(mfaPreference) {\n if (mfaPreference === 'DISABLED') {\n return {\n Enabled: false,\n };\n }\n else if (mfaPreference === 'PREFERRED') {\n return {\n Enabled: true,\n PreferredMfa: true,\n };\n }\n else if (mfaPreference === 'ENABLED') {\n return {\n Enabled: true,\n };\n }\n else if (mfaPreference === 'NOT_PREFERRED') {\n return {\n Enabled: true,\n PreferredMfa: false,\n };\n }\n}\nexports.getMFASettings = getMFASettings;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AACzD,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAC1C,MAAM,yBAAyB,GAAG,OAAO,CAAC,sEAAsE,CAAC,CAAC;AAClH,MAAM,WAAW,G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B,GAAG,mBAAmB,CAAC;AAClD,SAAS,cAAc,CAAC,aAAa,EAAE;AACvC,IAAI,IAAI,aAAa,KAAK,UAAU,EAAE;AACtC,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,WAAW,EAAE;AAC5C,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,YAAY,YAAY,EAAE,IAAI;AAC9B,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,SAAS,EAAE;AAC1C,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,eAAe,EAAE;AAChD,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,YAAY,YAAY,EAAE,KAAK;AAC/B,SAAS,CAAC;AACV,KAAK;AACL,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
1
+ {"version":3,"file":"updateMFAPreference.js","sources":["../../../../../src/providers/cognito/apis/updateMFAPreference.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getMFASettings = exports.updateMFAPreference = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\nconst types_1 = require(\"../utils/types\");\nconst utils_2 = require(\"../../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../../../foundation/factories/serviceClients/cognitoIdentityProvider\");\nconst factories_1 = require(\"../factories\");\n/**\n * Updates the MFA preference of the user.\n *\n * @param input - The UpdateMFAPreferenceInput object.\n * @throws -{@link SetUserMFAPreferenceException } - Service error thrown when the MFA preference cannot be updated.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function updateMFAPreference(input) {\n const { sms, totp, email } = input;\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await (0, core_1.fetchAuthSession)({ forceRefresh: false });\n (0, types_1.assertAuthTokens)(tokens);\n const setUserMFAPreference = (0, cognitoIdentityProvider_1.createSetUserMFAPreferenceClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await setUserMFAPreference({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.UpdateMFAPreference),\n }, {\n AccessToken: tokens.accessToken.toString(),\n SMSMfaSettings: getMFASettings(sms),\n SoftwareTokenMfaSettings: getMFASettings(totp),\n EmailMfaSettings: getMFASettings(email),\n });\n}\nexports.updateMFAPreference = updateMFAPreference;\nfunction getMFASettings(mfaPreference) {\n if (mfaPreference === 'DISABLED') {\n return {\n Enabled: false,\n };\n }\n else if (mfaPreference === 'PREFERRED') {\n return {\n Enabled: true,\n PreferredMfa: true,\n };\n }\n else if (mfaPreference === 'ENABLED') {\n return {\n Enabled: true,\n };\n }\n else if (mfaPreference === 'NOT_PREFERRED') {\n return {\n Enabled: true,\n PreferredMfa: false,\n };\n }\n}\nexports.getMFASettings = getMFASettings;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC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AAU,CAAC,mBAAmB,CAAC;AAClG,KAAK,EAAE;AACP,QAAQ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;AAClD,QAAQ,cAAc,EAAE,cAAc,CAAC,GAAG,CAAC;AAC3C,QAAQ,wBAAwB,EAAE,cAAc,CAAC,IAAI,CAAC;AACtD,QAAQ,gBAAgB,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/C,KAAK,CAAC,CAAC;AACP,CAAC;AACD,OAAO,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AAClD,SAAS,cAAc,CAAC,aAAa,EAAE;AACvC,IAAI,IAAI,aAAa,KAAK,UAAU,EAAE;AACtC,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,KAAK;AAC1B,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,WAAW,EAAE;AAC5C,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,YAAY,YAAY,EAAE,IAAI;AAC9B,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,SAAS,EAAE;AAC1C,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,SAAS,CAAC;AACV,KAAK;AACL,SAAS,IAAI,aAAa,KAAK,eAAe,EAAE;AAChD,QAAQ,OAAO;AACf,YAAY,OAAO,EAAE,IAAI;AACzB,YAAY,YAAY,EAAE,KAAK;AAC/B,SAAS,CAAC;AACV,KAAK;AACL,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc;;"}
@@ -17,6 +17,7 @@ class DefaultIdentityIdStore {
17
17
  }
18
18
  constructor(keyValueStorage) {
19
19
  this._authKeys = {};
20
+ this._hasGuestIdentityId = false;
20
21
  this.keyValueStorage = keyValueStorage;
21
22
  }
22
23
  async loadIdentityId() {
@@ -31,6 +32,7 @@ class DefaultIdentityIdStore {
31
32
  else {
32
33
  const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);
33
34
  if (storedIdentityId) {
35
+ this._hasGuestIdentityId = true;
34
36
  return {
35
37
  id: storedIdentityId,
36
38
  type: 'guest',
@@ -50,11 +52,15 @@ class DefaultIdentityIdStore {
50
52
  this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);
51
53
  // Clear in-memory storage of primary identityId
52
54
  this._primaryIdentityId = undefined;
55
+ this._hasGuestIdentityId = true;
53
56
  }
54
57
  else {
55
58
  this._primaryIdentityId = identity.id;
56
59
  // Clear locally stored guest id
57
- this.keyValueStorage.removeItem(this._authKeys.identityId);
60
+ if (this._hasGuestIdentityId) {
61
+ this.keyValueStorage.removeItem(this._authKeys.identityId);
62
+ this._hasGuestIdentityId = false;
63
+ }
58
64
  }
59
65
  }
60
66
  async clearIdentityId() {
@@ -1 +1 @@
1
- {"version":3,"file":"IdentityIdStore.js","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultIdentityIdStore = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst TokenStore_1 = require(\"../tokenProvider/TokenStore\");\nconst types_1 = require(\"./types\");\nconst logger = new core_1.ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n (0, utils_1.assertIdentityPoolIdConfig)(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nexports.DefaultIdentityIdStore = DefaultIdentityIdStore;\nconst createKeysForAuthStorage = (provider, identifier) => {\n return (0, TokenStore_1.getAuthStorageKeys)(types_1.IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,sBAAsB,GAAG,KAAK,CAAC,CAAC;AACxC,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC,CAAC;AAC7D,MAAM,YAAY,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;AACnC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC;AAClE,MAAM,sBAAsB,CAAC;AAC7B,IAAI,aAAa,CAAC,eAAe,EAAE;AACnC,QAAQ,IAAI,OAAO,CAAC,0BAA0B,EAAE,eAAe,CAAC,O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EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAC1E,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,OAAO,EAAE;AACvC,YAAY,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;AACjF;AACA,YAAY,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAChD,SAAS;AACT,aAAa;AACb,YAAY,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,EAAE,CAAC;AAClD;AACA,YAAY,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACvE,SAAS;AACT,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAC5C,QAAQ,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACzE,KAAK;AACL,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACxD,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK;AAC3D,IAAI,OAAO,IAAI,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACtH,CAAC;;"}
1
+ {"version":3,"file":"IdentityIdStore.js","sources":["../../../../../src/providers/cognito/credentialsProvider/IdentityIdStore.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DefaultIdentityIdStore = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst TokenStore_1 = require(\"../tokenProvider/TokenStore\");\nconst types_1 = require(\"./types\");\nconst logger = new core_1.ConsoleLogger('DefaultIdentityIdStore');\nclass DefaultIdentityIdStore {\n setAuthConfig(authConfigParam) {\n (0, utils_1.assertIdentityPoolIdConfig)(authConfigParam.Cognito);\n this.authConfig = authConfigParam;\n this._authKeys = createKeysForAuthStorage('Cognito', authConfigParam.Cognito.identityPoolId);\n }\n constructor(keyValueStorage) {\n this._authKeys = {};\n this._hasGuestIdentityId = false;\n this.keyValueStorage = keyValueStorage;\n }\n async loadIdentityId() {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n try {\n if (this._primaryIdentityId) {\n return {\n id: this._primaryIdentityId,\n type: 'primary',\n };\n }\n else {\n const storedIdentityId = await this.keyValueStorage.getItem(this._authKeys.identityId);\n if (storedIdentityId) {\n this._hasGuestIdentityId = true;\n return {\n id: storedIdentityId,\n type: 'guest',\n };\n }\n return null;\n }\n }\n catch (err) {\n logger.log('Error getting stored IdentityId.', err);\n return null;\n }\n }\n async storeIdentityId(identity) {\n (0, utils_1.assertIdentityPoolIdConfig)(this.authConfig?.Cognito);\n if (identity.type === 'guest') {\n this.keyValueStorage.setItem(this._authKeys.identityId, identity.id);\n // Clear in-memory storage of primary identityId\n this._primaryIdentityId = undefined;\n this._hasGuestIdentityId = true;\n }\n else {\n this._primaryIdentityId = identity.id;\n // Clear locally stored guest id\n if (this._hasGuestIdentityId) {\n this.keyValueStorage.removeItem(this._authKeys.identityId);\n this._hasGuestIdentityId = false;\n }\n }\n }\n async clearIdentityId() {\n this._primaryIdentityId = undefined;\n await this.keyValueStorage.removeItem(this._authKeys.identityId);\n }\n}\nexports.DefaultIdentityIdStore = DefaultIdentityIdStore;\nconst createKeysForAuthStorage = (provider, identifier) => {\n return (0, TokenStore_1.getAuthStorageKeys)(types_1.IdentityIdStorageKeys)(`com.amplify.${provider}`, identifier);\n};\n"],"names":[],"mappings":";;AACA;AACA;AAC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AC3E,gBAAgB,IAAI,CAAC,mBAAmB,GAAG,KAAK,CAAC;AACjD,aAAa;AACb,SAAS;AACT,KAAK;AACL,IAAI,MAAM,eAAe,GAAG;AAC5B,QAAQ,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;AAC5C,QAAQ,MAAM,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;AACzE,KAAK;AACL,CAAC;AACD,OAAO,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;AACxD,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,KAAK;AAC3D,IAAI,OAAO,IAAI,YAAY,CAAC,kBAAkB,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;AACtH,CAAC;;"}
@@ -29,7 +29,9 @@ function getRedirectUrl(redirects, preferredRedirectUrl) {
29
29
  }
30
30
  exports.getRedirectUrl = getRedirectUrl;
31
31
  // origin + pathname => https://example.com/app
32
- const isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));
32
+ const isSameOriginAndPathName = (redirect) => redirect.startsWith(
33
+ // eslint-disable-next-line no-constant-binary-expression
34
+ String(window.location.origin + window.location.pathname ?? '/'));
33
35
  // domain => outlook.live.com, github.com
34
36
  const isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));
35
37
  const isHttp = (redirect) => redirect.startsWith('http://');
@@ -1 +1 @@
1
- {"version":3,"file":"getRedirectUrl.js","sources":["../../../../../../src/providers/cognito/utils/oauth/getRedirectUrl.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRedirectUrl = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constants_1 = require(\"../../../../errors/constants\");\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw constants_1.invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw constants_1.invalidOriginException;\n }\n throw constants_1.invalidRedirectException;\n }\n}\nexports.getRedirectUrl = getRedirectUrl;\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(String(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC;AACA;AACA,MAAM,WAAW,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC5D;AACA,SAAS,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE;AACzD,IAAI,IAAI,oBAAoB,EAAE;AAC9B,QAAQ,MAAM,WAAW,GAAG,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,oBAAoB,CAAC,CAAC;AAC3F,QAAQ,IAAI,CAAC,WAAW,EAAE;AAC1B,YAAY,MAAM,WAAW,CAAC,oCAAoC,CAAC;AACnE,SAAS;AACT,QAAQ,OAAO,WAAW,CAAC;AAC3B,KAAK;AACL,SAAS;AACT,QAAQ,MAAM,4BAA4B,GAAG,SAAS,EAAE,IAAI,CAAC,uBAAuB,CAAC;AACrF,YAAY,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;AAC7C,QAAQ,MAAM,8BAA8B,GAAG,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;AACnG,QAAQ,IAAI,4BAA4B,EAAE;AAC1C,YAAY,OAAO,4BAA4B,CAAC;AAChD,SAAS;AACT,aAAa,IAAI,8BAA8B,EAAE;AACjD,YAAY,MAAM,WAAW,CAAC,sBAAsB,CAAC;AACrD,SAAS;AACT,QAAQ,MAAM,WAAW,CAAC,wBAAwB,CAAC;AACnD,KAAK;AACL,CAAC;AACD,OAAO,CAAC,cAAc,GAAG,cAAc,CAAC;AACxC;AACA,MAAM,uBAAuB,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC,CAAC;AACpI;AACA,MAAM,eAAe,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC1F,MAAM,MAAM,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AAC5D,MAAM,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;;"}
1
+ {"version":3,"file":"getRedirectUrl.js","sources":["../../../../../../src/providers/cognito/utils/oauth/getRedirectUrl.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRedirectUrl = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst constants_1 = require(\"../../../../errors/constants\");\n/** @internal */\nfunction getRedirectUrl(redirects, preferredRedirectUrl) {\n if (preferredRedirectUrl) {\n const redirectUrl = redirects?.find(redirect => redirect === preferredRedirectUrl);\n if (!redirectUrl) {\n throw constants_1.invalidPreferredRedirectUrlException;\n }\n return redirectUrl;\n }\n else {\n const redirectUrlFromTheSameOrigin = redirects?.find(isSameOriginAndPathName) ??\n redirects?.find(isTheSameDomain);\n const redirectUrlFromDifferentOrigin = redirects?.find(isHttps) ?? redirects?.find(isHttp);\n if (redirectUrlFromTheSameOrigin) {\n return redirectUrlFromTheSameOrigin;\n }\n else if (redirectUrlFromDifferentOrigin) {\n throw constants_1.invalidOriginException;\n }\n throw constants_1.invalidRedirectException;\n }\n}\nexports.getRedirectUrl = getRedirectUrl;\n// origin + pathname => https://example.com/app\nconst isSameOriginAndPathName = (redirect) => redirect.startsWith(\n// eslint-disable-next-line no-constant-binary-expression\nString(window.location.origin + window.location.pathname ?? '/'));\n// domain => outlook.live.com, github.com\nconst isTheSameDomain = (redirect) => redirect.includes(String(window.location.hostname));\nconst isHttp = (redirect) => redirect.startsWith('http://');\nconst isHttps = (redirect) => redirect.startsWith('https://');\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,cAAc,GAAG,KAAK,CAAC,CAAC;AAChC;AACA;AACA,MAAM,WAAW,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAAC;AAC5D;AACA,SAAS,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE;AACzD,IAAI,IAAI,oBAAoB,EAAE;AAC9B,QAAQ,MAAM,WAAW,GAAG,SAAS,EAAE,IAAI,CAAC,QAAQ,IAAI,QAAQ,KAAK,oBAAoB,CAAC,CAAC;AAC3F,QAAQ,IAAI,CAAC,WAAW,EAAE;AAC1B,YAAY,MAAM,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