@aws-amplify/auth 6.12.4 → 6.12.5-unstable.3c4d29e.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 (173) hide show
  1. package/dist/cjs/client/apis/associateWebAuthnCredential.js +1 -2
  2. package/dist/cjs/client/apis/associateWebAuthnCredential.js.map +1 -1
  3. package/dist/cjs/client/apis/deleteWebAuthnCredential.js +1 -2
  4. package/dist/cjs/client/apis/deleteWebAuthnCredential.js.map +1 -1
  5. package/dist/cjs/client/apis/listWebAuthnCredentials.js +1 -2
  6. package/dist/cjs/client/apis/listWebAuthnCredentials.js.map +1 -1
  7. package/dist/cjs/client/flows/shared/handlePasswordSRP.js +1 -2
  8. package/dist/cjs/client/flows/shared/handlePasswordSRP.js.map +1 -1
  9. package/dist/cjs/client/flows/userAuth/handleSelectChallenge.js +1 -2
  10. package/dist/cjs/client/flows/userAuth/handleSelectChallenge.js.map +1 -1
  11. package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js +1 -2
  12. package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPassword.js.map +1 -1
  13. package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js +1 -2
  14. package/dist/cjs/client/flows/userAuth/handleSelectChallengeWithPasswordSRP.js.map +1 -1
  15. package/dist/cjs/client/flows/userAuth/handleUserAuthFlow.js +1 -2
  16. package/dist/cjs/client/flows/userAuth/handleUserAuthFlow.js.map +1 -1
  17. package/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js +1 -2
  18. package/dist/cjs/client/flows/userAuth/handleWebAuthnSignInResult.js.map +1 -1
  19. package/dist/cjs/client/utils/passkey/errors.js +1 -1
  20. package/dist/cjs/client/utils/passkey/errors.js.map +1 -1
  21. package/dist/cjs/client/utils/passkey/types/index.js +3 -3
  22. package/dist/cjs/client/utils/passkey/types/index.js.map +1 -1
  23. package/dist/cjs/client/utils/passkey/types/shared.js +1 -2
  24. package/dist/cjs/client/utils/passkey/types/shared.js.map +1 -1
  25. package/dist/cjs/client/utils/store/signInStore.js +2 -2
  26. package/dist/cjs/client/utils/store/signInStore.js.map +1 -1
  27. package/dist/cjs/common/AuthErrorStrings.js +5 -2
  28. package/dist/cjs/common/AuthErrorStrings.js.map +1 -1
  29. package/dist/cjs/errors/types/validation.js +2 -1
  30. package/dist/cjs/errors/types/validation.js.map +1 -1
  31. package/dist/cjs/errors/utils/assertServiceError.js +1 -2
  32. package/dist/cjs/errors/utils/assertServiceError.js.map +1 -1
  33. package/dist/cjs/errors/utils/assertValidationError.js +1 -2
  34. package/dist/cjs/errors/utils/assertValidationError.js.map +1 -1
  35. package/dist/cjs/foundation/apis/deleteWebAuthnCredential.js +1 -2
  36. package/dist/cjs/foundation/apis/deleteWebAuthnCredential.js.map +1 -1
  37. package/dist/cjs/foundation/apis/listWebAuthnCredentials.js +1 -2
  38. package/dist/cjs/foundation/apis/listWebAuthnCredentials.js.map +1 -1
  39. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.js +8 -4
  40. package/dist/cjs/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.js.map +1 -1
  41. package/dist/cjs/foundation/parsers/regionParsers.js +2 -3
  42. package/dist/cjs/foundation/parsers/regionParsers.js.map +1 -1
  43. package/dist/cjs/providers/cognito/apis/autoSignIn.js +3 -3
  44. package/dist/cjs/providers/cognito/apis/autoSignIn.js.map +1 -1
  45. package/dist/cjs/providers/cognito/apis/confirmResetPassword.js +1 -2
  46. package/dist/cjs/providers/cognito/apis/confirmResetPassword.js.map +1 -1
  47. package/dist/cjs/providers/cognito/apis/confirmSignIn.js +1 -2
  48. package/dist/cjs/providers/cognito/apis/confirmSignIn.js.map +1 -1
  49. package/dist/cjs/providers/cognito/apis/confirmSignUp.js +1 -2
  50. package/dist/cjs/providers/cognito/apis/confirmSignUp.js.map +1 -1
  51. package/dist/cjs/providers/cognito/apis/confirmUserAttribute.js +1 -2
  52. package/dist/cjs/providers/cognito/apis/confirmUserAttribute.js.map +1 -1
  53. package/dist/cjs/providers/cognito/apis/deleteUser.js +1 -2
  54. package/dist/cjs/providers/cognito/apis/deleteUser.js.map +1 -1
  55. package/dist/cjs/providers/cognito/apis/deleteUserAttributes.js +1 -2
  56. package/dist/cjs/providers/cognito/apis/deleteUserAttributes.js.map +1 -1
  57. package/dist/cjs/providers/cognito/apis/fetchDevices.js +1 -2
  58. package/dist/cjs/providers/cognito/apis/fetchDevices.js.map +1 -1
  59. package/dist/cjs/providers/cognito/apis/fetchMFAPreference.js +1 -2
  60. package/dist/cjs/providers/cognito/apis/fetchMFAPreference.js.map +1 -1
  61. package/dist/cjs/providers/cognito/apis/forgetDevice.js +1 -2
  62. package/dist/cjs/providers/cognito/apis/forgetDevice.js.map +1 -1
  63. package/dist/cjs/providers/cognito/apis/rememberDevice.js +1 -2
  64. package/dist/cjs/providers/cognito/apis/rememberDevice.js.map +1 -1
  65. package/dist/cjs/providers/cognito/apis/resendSignUpCode.js +1 -2
  66. package/dist/cjs/providers/cognito/apis/resendSignUpCode.js.map +1 -1
  67. package/dist/cjs/providers/cognito/apis/resetPassword.js +1 -2
  68. package/dist/cjs/providers/cognito/apis/resetPassword.js.map +1 -1
  69. package/dist/cjs/providers/cognito/apis/setUpTOTP.js +1 -2
  70. package/dist/cjs/providers/cognito/apis/setUpTOTP.js.map +1 -1
  71. package/dist/cjs/providers/cognito/apis/signIn.js +1 -2
  72. package/dist/cjs/providers/cognito/apis/signIn.js.map +1 -1
  73. package/dist/cjs/providers/cognito/apis/signInWithCustomAuth.js +1 -2
  74. package/dist/cjs/providers/cognito/apis/signInWithCustomAuth.js.map +1 -1
  75. package/dist/cjs/providers/cognito/apis/signInWithCustomSRPAuth.js +1 -2
  76. package/dist/cjs/providers/cognito/apis/signInWithCustomSRPAuth.js.map +1 -1
  77. package/dist/cjs/providers/cognito/apis/signInWithRedirect.js +1 -2
  78. package/dist/cjs/providers/cognito/apis/signInWithRedirect.js.map +1 -1
  79. package/dist/cjs/providers/cognito/apis/signInWithSRP.js +1 -2
  80. package/dist/cjs/providers/cognito/apis/signInWithSRP.js.map +1 -1
  81. package/dist/cjs/providers/cognito/apis/signInWithUserAuth.js +1 -2
  82. package/dist/cjs/providers/cognito/apis/signInWithUserAuth.js.map +1 -1
  83. package/dist/cjs/providers/cognito/apis/signInWithUserPassword.js +1 -2
  84. package/dist/cjs/providers/cognito/apis/signInWithUserPassword.js.map +1 -1
  85. package/dist/cjs/providers/cognito/apis/signOut.js +1 -2
  86. package/dist/cjs/providers/cognito/apis/signOut.js.map +1 -1
  87. package/dist/cjs/providers/cognito/apis/signUp.js +1 -2
  88. package/dist/cjs/providers/cognito/apis/signUp.js.map +1 -1
  89. package/dist/cjs/providers/cognito/apis/updateMFAPreference.js +2 -3
  90. package/dist/cjs/providers/cognito/apis/updateMFAPreference.js.map +1 -1
  91. package/dist/cjs/providers/cognito/apis/updatePassword.js +1 -2
  92. package/dist/cjs/providers/cognito/apis/updatePassword.js.map +1 -1
  93. package/dist/cjs/providers/cognito/apis/verifyTOTPSetup.js +1 -2
  94. package/dist/cjs/providers/cognito/apis/verifyTOTPSetup.js.map +1 -1
  95. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdProvider.js +1 -2
  96. package/dist/cjs/providers/cognito/credentialsProvider/IdentityIdProvider.js.map +1 -1
  97. package/dist/cjs/providers/cognito/credentialsProvider/utils.js +1 -2
  98. package/dist/cjs/providers/cognito/credentialsProvider/utils.js.map +1 -1
  99. package/dist/cjs/providers/cognito/tokenProvider/TokenStore.js +2 -2
  100. package/dist/cjs/providers/cognito/tokenProvider/TokenStore.js.map +1 -1
  101. package/dist/cjs/providers/cognito/tokenProvider/cacheTokens.js +1 -2
  102. package/dist/cjs/providers/cognito/tokenProvider/cacheTokens.js.map +1 -1
  103. package/dist/cjs/providers/cognito/tokenProvider/errorHelpers.js +1 -1
  104. package/dist/cjs/providers/cognito/tokenProvider/errorHelpers.js.map +1 -1
  105. package/dist/cjs/providers/cognito/types/errors.js +48 -24
  106. package/dist/cjs/providers/cognito/types/errors.js.map +1 -1
  107. package/dist/cjs/providers/cognito/utils/apiHelpers.js +2 -3
  108. package/dist/cjs/providers/cognito/utils/apiHelpers.js.map +1 -1
  109. package/dist/cjs/providers/cognito/utils/getNewDeviceMetadata.js +1 -2
  110. package/dist/cjs/providers/cognito/utils/getNewDeviceMetadata.js.map +1 -1
  111. package/dist/cjs/providers/cognito/utils/handleDeviceSRPAuth.js +1 -2
  112. package/dist/cjs/providers/cognito/utils/handleDeviceSRPAuth.js.map +1 -1
  113. package/dist/cjs/providers/cognito/utils/handlePasswordVerifierChallenge.js +1 -2
  114. package/dist/cjs/providers/cognito/utils/handlePasswordVerifierChallenge.js.map +1 -1
  115. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.js +2 -5
  116. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.js.map +1 -1
  117. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.native.js +1 -2
  118. package/dist/cjs/providers/cognito/utils/oauth/getRedirectUrl.native.js.map +1 -1
  119. package/dist/cjs/providers/cognito/utils/retryOnResourceNotFoundException.js +1 -2
  120. package/dist/cjs/providers/cognito/utils/retryOnResourceNotFoundException.js.map +1 -1
  121. package/dist/cjs/providers/cognito/utils/setActiveSignInUsername.js +1 -2
  122. package/dist/cjs/providers/cognito/utils/setActiveSignInUsername.js.map +1 -1
  123. package/dist/cjs/providers/cognito/utils/signInHelpers.js +22 -23
  124. package/dist/cjs/providers/cognito/utils/signInHelpers.js.map +1 -1
  125. package/dist/cjs/providers/cognito/utils/signUpHelpers.js +3 -3
  126. package/dist/cjs/providers/cognito/utils/signUpHelpers.js.map +1 -1
  127. package/dist/cjs/providers/cognito/utils/types.js +6 -6
  128. package/dist/cjs/providers/cognito/utils/types.js.map +1 -1
  129. package/dist/cjs/providers/cognito/utils/userContextData.js +1 -2
  130. package/dist/cjs/providers/cognito/utils/userContextData.js.map +1 -1
  131. package/dist/cjs/providers/cognito/utils/userContextData.native.js +1 -2
  132. package/dist/cjs/providers/cognito/utils/userContextData.native.js.map +1 -1
  133. package/dist/cjs/types/Auth.js +2 -1
  134. package/dist/cjs/types/Auth.js.map +1 -1
  135. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/constants.d.ts +1 -1
  136. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createAssociateSoftwareTokenClient.d.ts +2 -2
  137. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createChangePasswordClient.d.ts +2 -2
  138. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createCompleteWebAuthnRegistrationClient.d.ts +2 -2
  139. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmDeviceClient.d.ts +2 -2
  140. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmForgotPasswordClient.d.ts +2 -2
  141. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createConfirmSignUpClient.d.ts +2 -2
  142. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteUserAttributesClient.d.ts +2 -2
  143. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteUserClient.d.ts +2 -2
  144. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createDeleteWebAuthnCredentialClient.d.ts +2 -2
  145. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgetDeviceClient.d.ts +2 -2
  146. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createForgotPasswordClient.d.ts +2 -2
  147. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserAttributeVerificationCodeClient.d.ts +2 -2
  148. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGetUserClient.d.ts +2 -2
  149. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createGlobalSignOutClient.d.ts +2 -2
  150. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createInitiateAuthClient.d.ts +2 -2
  151. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListDevicesClient.d.ts +2 -2
  152. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createListWebAuthnCredentialsClient.d.ts +2 -2
  153. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createResendConfirmationCodeClient.d.ts +2 -2
  154. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRespondToAuthChallengeClient.d.ts +2 -2
  155. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createRevokeTokenClient.d.ts +2 -2
  156. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSetUserMFAPreferenceClient.d.ts +2 -2
  157. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createSignUpClient.d.ts +3 -3
  158. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createStartWebAuthnRegistrationClient.d.ts +2 -2
  159. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateDeviceStatusClient.d.ts +2 -2
  160. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createUpdateUserAttributesClient.d.ts +2 -2
  161. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifySoftwareTokenClient.d.ts +2 -2
  162. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/createVerifyUserAttributeClient.d.ts +2 -2
  163. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createEmptyResponseDeserializer.d.ts +1 -1
  164. package/dist/esm/foundation/factories/serviceClients/cognitoIdentityProvider/shared/serde/createUserPoolDeserializer.d.ts +1 -1
  165. package/dist/esm/providers/cognito/utils/oauth/attemptCompleteOAuthFlow.d.ts +1 -1
  166. package/dist/esm/providers/cognito/utils/oauth/completeOAuthFlow.d.ts +1 -1
  167. package/dist/esm/providers/cognito/utils/oauth/generateCodeVerifier.d.ts +1 -1
  168. package/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs +1 -3
  169. package/dist/esm/providers/cognito/utils/oauth/getRedirectUrl.mjs.map +1 -1
  170. package/dist/esm/providers/cognito/utils/refreshAuthTokens.d.ts +1 -1
  171. package/dist/esm/providers/cognito/utils/signInHelpers.d.ts +1 -1
  172. package/package.json +105 -106
  173. package/src/providers/cognito/utils/oauth/getRedirectUrl.ts +1 -2
@@ -1 +1 @@
1
- {"version":3,"file":"signInStore.js","sources":["../../../../../src/client/utils/store/signInStore.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.persistSignInState = exports.setActiveSignInState = exports.signInStore = exports.resetActiveSignInState = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\n// Minutes until stored session invalidates is defaulted to 3 minutes\n// to maintain parity with Amazon Cognito user pools API behavior\nconst MS_TO_EXPIRY = 3 * 60 * 1000;\nconst TGT_STATE = 'CognitoSignInState';\nconst SIGN_IN_STATE_KEYS = {\n username: `${TGT_STATE}.username`,\n challengeName: `${TGT_STATE}.challengeName`,\n signInSession: `${TGT_STATE}.signInSession`,\n expiry: `${TGT_STATE}.expiry`,\n};\nconst signInReducer = (state, action) => {\n switch (action.type) {\n case 'SET_SIGN_IN_SESSION':\n (0, exports.persistSignInState)({ signInSession: action.value });\n return {\n ...state,\n signInSession: action.value,\n };\n case 'SET_SIGN_IN_STATE':\n (0, exports.persistSignInState)(action.value);\n return {\n ...action.value,\n };\n case 'SET_CHALLENGE_NAME':\n (0, exports.persistSignInState)({ challengeName: action.value });\n return {\n ...state,\n challengeName: action.value,\n };\n case 'SET_USERNAME':\n (0, exports.persistSignInState)({ username: action.value });\n return {\n ...state,\n username: action.value,\n };\n case 'SET_INITIAL_STATE':\n return getInitialState();\n case 'RESET_STATE':\n clearPersistedSignInState();\n return getDefaultState();\n // this state is never reachable\n default:\n return state;\n }\n};\nconst isExpired = (expiryDate) => {\n const expiryTimestamp = Number(expiryDate);\n const currentTimestamp = Date.now();\n return expiryTimestamp <= currentTimestamp;\n};\nconst resetActiveSignInState = () => {\n exports.signInStore.dispatch({ type: 'RESET_STATE' });\n};\nexports.resetActiveSignInState = resetActiveSignInState;\nconst clearPersistedSignInState = () => {\n for (const stateKey of Object.values(SIGN_IN_STATE_KEYS)) {\n core_1.syncSessionStorage.removeItem(stateKey);\n }\n};\nconst getDefaultState = () => ({\n username: undefined,\n challengeName: undefined,\n signInSession: undefined,\n});\n// Hydrate signInStore from syncSessionStorage if the session has not expired\nconst getInitialState = () => {\n const expiry = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.expiry);\n if (!expiry || isExpired(expiry)) {\n clearPersistedSignInState();\n return getDefaultState();\n }\n const username = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.username) ?? undefined;\n const challengeName = (core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.challengeName) ?? undefined);\n const signInSession = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.signInSession) ?? undefined;\n return {\n username,\n challengeName,\n signInSession,\n };\n};\nconst createStore = reducer => {\n let currentState = reducer(getDefaultState(), { type: 'SET_INITIAL_STATE' });\n return {\n getState: () => currentState,\n dispatch: action => {\n currentState = reducer(currentState, action);\n },\n };\n};\nexports.signInStore = createStore(signInReducer);\nfunction setActiveSignInState(state) {\n exports.signInStore.dispatch({\n type: 'SET_SIGN_IN_STATE',\n value: state,\n });\n}\nexports.setActiveSignInState = setActiveSignInState;\n// Save local state into Session Storage\nconst persistSignInState = ({ challengeName, signInSession, username, }) => {\n username && core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.username, username);\n challengeName &&\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.challengeName, challengeName);\n if (signInSession) {\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.signInSession, signInSession);\n // Updates expiry when session is passed\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.expiry, String(Date.now() + MS_TO_EXPIRY));\n }\n};\nexports.persistSignInState = persistSignInState;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AACzH,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C;AACA;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;AAClC,MAAM,SAAS,GAAG,oBAAoB;AACtC,MAAM,kBAAkB,GAAG;AAC3B,IAAI,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC;AACrC,IAAI,aAAa,EAAE,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC;AAC/C,IAAI,aAAa,EAAE,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC;AAC/C,IAAI,MAAM,EAAE,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC;AACjC,CAAC;AACD,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK;AACzC,IAAI,QAAQ,MAAM,CAAC,IAAI;AACvB,QAAQ,KAAK,qBAAqB;AAClC,YAAY,IAAI,OAAO,CAAC,kBAAkB,EAAE,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AAC5E,YAAY,OAAO;AACnB,gBAAgB,GAAG,KAAK;AACxB,gBAAgB,aAAa,EAAE,MAAM,CAAC,KAAK;AAC3C,aAAa;AACb,QAAQ,KAAK,mBAAmB;AAChC,YAAY,IAAI,OAAO,CAAC,kBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC;AACzD,YAAY,OAAO;AACnB,gBAAgB,GAAG,MAAM,C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B,CAAC,KAAK,EAAE;AACrC,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC;AACjC,QAAQ,IAAI,EAAE,mBAAmB;AACjC,QAAQ,KAAK,EAAE,KAAK;AACpB,KAAK,CAAC;AACN;AACA,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;AACnD;AACA,MAAM,kBAAkB,GAAG,CAAC,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,GAAG,KAAK;AAC5E,IAAI,QAAQ,IAAI,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC;AACxF,IAAI,aAAa;AACjB,QAAQ,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC;AAC1F,IAAI,IAAI,aAAa,EAAE;AACvB,QAAQ,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,aAAa,EAAE,aAAa,CAAC;AAC1F;AACA,QAAQ,MAAM,CAAC,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,CAAC;AACvG;AACA,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
1
+ {"version":3,"file":"signInStore.js","sources":["../../../../../src/client/utils/store/signInStore.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.persistSignInState = exports.signInStore = exports.resetActiveSignInState = void 0;\nexports.setActiveSignInState = setActiveSignInState;\nconst core_1 = require(\"@aws-amplify/core\");\n// Minutes until stored session invalidates is defaulted to 3 minutes\n// to maintain parity with Amazon Cognito user pools API behavior\nconst MS_TO_EXPIRY = 3 * 60 * 1000;\nconst TGT_STATE = 'CognitoSignInState';\nconst SIGN_IN_STATE_KEYS = {\n username: `${TGT_STATE}.username`,\n challengeName: `${TGT_STATE}.challengeName`,\n signInSession: `${TGT_STATE}.signInSession`,\n expiry: `${TGT_STATE}.expiry`,\n};\nconst signInReducer = (state, action) => {\n switch (action.type) {\n case 'SET_SIGN_IN_SESSION':\n (0, exports.persistSignInState)({ signInSession: action.value });\n return {\n ...state,\n signInSession: action.value,\n };\n case 'SET_SIGN_IN_STATE':\n (0, exports.persistSignInState)(action.value);\n return {\n ...action.value,\n };\n case 'SET_CHALLENGE_NAME':\n (0, exports.persistSignInState)({ challengeName: action.value });\n return {\n ...state,\n challengeName: action.value,\n };\n case 'SET_USERNAME':\n (0, exports.persistSignInState)({ username: action.value });\n return {\n ...state,\n username: action.value,\n };\n case 'SET_INITIAL_STATE':\n return getInitialState();\n case 'RESET_STATE':\n clearPersistedSignInState();\n return getDefaultState();\n // this state is never reachable\n default:\n return state;\n }\n};\nconst isExpired = (expiryDate) => {\n const expiryTimestamp = Number(expiryDate);\n const currentTimestamp = Date.now();\n return expiryTimestamp <= currentTimestamp;\n};\nconst resetActiveSignInState = () => {\n exports.signInStore.dispatch({ type: 'RESET_STATE' });\n};\nexports.resetActiveSignInState = resetActiveSignInState;\nconst clearPersistedSignInState = () => {\n for (const stateKey of Object.values(SIGN_IN_STATE_KEYS)) {\n core_1.syncSessionStorage.removeItem(stateKey);\n }\n};\nconst getDefaultState = () => ({\n username: undefined,\n challengeName: undefined,\n signInSession: undefined,\n});\n// Hydrate signInStore from syncSessionStorage if the session has not expired\nconst getInitialState = () => {\n const expiry = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.expiry);\n if (!expiry || isExpired(expiry)) {\n clearPersistedSignInState();\n return getDefaultState();\n }\n const username = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.username) ?? undefined;\n const challengeName = (core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.challengeName) ?? undefined);\n const signInSession = core_1.syncSessionStorage.getItem(SIGN_IN_STATE_KEYS.signInSession) ?? undefined;\n return {\n username,\n challengeName,\n signInSession,\n };\n};\nconst createStore = reducer => {\n let currentState = reducer(getDefaultState(), { type: 'SET_INITIAL_STATE' });\n return {\n getState: () => currentState,\n dispatch: action => {\n currentState = reducer(currentState, action);\n },\n };\n};\nexports.signInStore = createStore(signInReducer);\nfunction setActiveSignInState(state) {\n exports.signInStore.dispatch({\n type: 'SET_SIGN_IN_STATE',\n value: state,\n });\n}\n// Save local state into Session Storage\nconst persistSignInState = ({ challengeName, signInSession, username, }) => {\n username && core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.username, username);\n challengeName &&\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.challengeName, challengeName);\n if (signInSession) {\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.signInSession, signInSession);\n // Updates expiry when session is passed\n core_1.syncSessionStorage.setItem(SIGN_IN_STATE_KEYS.expiry, String(Date.now() + MS_TO_EXPIRY));\n }\n};\nexports.persistSignInState = persistSignInState;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,sBAAsB,GAAG,MAAM;AAC1F,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;AACnD,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C;AACA;AACA,MAAM,YAAY,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI;AAClC,MAAM,SAAS,GAAG,oBAAoB;AACtC,MAAM,kBAAkB,GAAG;AAC3B,IAAI,QAAQ,EAAE,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC;AACrC,IAAI,aAAa,EAAE,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC;AAC/C,IAAI,aAAa,EAAE,CAAC,EAAE,S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CAAC,GAAG,EAAE,GAAG,YAAY,CAAC,CAAC;AACvG;AACA,CAAC;AACD,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
@@ -60,6 +60,8 @@ exports.validationErrorMap = {
60
60
  message: 'confirmation code is required to confirmUserAttribute',
61
61
  },
62
62
  };
63
+ // TODO: delete this code when the Auth class is removed.
64
+ var AuthErrorStrings;
63
65
  (function (AuthErrorStrings) {
64
66
  AuthErrorStrings["DEFAULT_MSG"] = "Authentication Error";
65
67
  AuthErrorStrings["EMPTY_EMAIL"] = "Email cannot be empty";
@@ -77,9 +79,10 @@ exports.validationErrorMap = {
77
79
  AuthErrorStrings["DEVICE_CONFIG"] = "Device tracking has not been configured in this User Pool";
78
80
  AuthErrorStrings["AUTOSIGNIN_ERROR"] = "Please use your credentials to sign in";
79
81
  AuthErrorStrings["OAUTH_ERROR"] = "Couldn't finish OAuth flow, check your User Pool HostedUI settings";
80
- })(exports.AuthErrorStrings || (exports.AuthErrorStrings = {}));
82
+ })(AuthErrorStrings || (exports.AuthErrorStrings = AuthErrorStrings = {}));
83
+ var AuthErrorCodes;
81
84
  (function (AuthErrorCodes) {
82
85
  AuthErrorCodes["SignInException"] = "SignInException";
83
86
  AuthErrorCodes["OAuthSignInError"] = "OAuthSignInException";
84
- })(exports.AuthErrorCodes || (exports.AuthErrorCodes = {}));
87
+ })(AuthErrorCodes || (exports.AuthErrorCodes = AuthErrorCodes = {}));
85
88
  //# sourceMappingURL=AuthErrorStrings.js.map
@@ -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, 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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AA0B;AACnE,IAAI,gBAAgB,CAAC,YAAY,CAAC,GAAG,mCAAmC;AACxE,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,wBAAwB;AAChE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,8BAA8B;AAC/D,IAAI,gBAAgB,CAAC,aAAa,CAAC,GAAG,kBAAkB;AACxD,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,oCAAoC;AAC9E,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,qDAAqD;AAC/F,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,eAAe;AACvD,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,2DAA2D;AACnG,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,wCAAwC;AACnF,IAAI,gBAAgB,CAAC,aAAa,CAAC,GAAG,oEAAoE;AAC1G,CAAC,EAAqB,OAAO,CAAC,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,GAAG,EAAE,CAAC,CAAC;AAElF,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;AACzD,IAAI,cAAc,CAAC,kBAAkB,CAAC,GAAG,sBAAsB;AAC/D,CAAC,EAAmB,OAAO,CAAC,cAAc,KAAK,OAAO,CAAC,cAAc,GAAG,EAAE,CAAC,CAAC;;"}
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, 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 = AuthErrorStrings = {}));\nvar AuthErrorCodes;\n(function (AuthErrorCodes) {\n AuthErrorCodes[\"SignInException\"] = \"SignInException\";\n AuthErrorCodes[\"OAuthSignInError\"] = \"OAuthSignInException\";\n})(AuthErrorCodes || (exports.AuthErrorCodes = AuthErrorCodes = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;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mC;AACxE,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,wBAAwB;AAChE,IAAI,gBAAgB,CAAC,QAAQ,CAAC,GAAG,8BAA8B;AAC/D,IAAI,gBAAgB,CAAC,aAAa,CAAC,GAAG,kBAAkB;AACxD,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,oCAAoC;AAC9E,IAAI,gBAAgB,CAAC,iBAAiB,CAAC,GAAG,qDAAqD;AAC/F,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,eAAe;AACvD,IAAI,gBAAgB,CAAC,eAAe,CAAC,GAAG,2DAA2D;AACnG,IAAI,gBAAgB,CAAC,kBAAkB,CAAC,GAAG,wCAAwC;AACnF,IAAI,gBAAgB,CAAC,aAAa,CAAC,GAAG,oEAAoE;AAC1G,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC,gBAAgB,GAAG,gBAAgB,GAAG,EAAE,CAAC,CAAC;AAC1E,IAAI,cAAc;AAClB,CAAC,UAAU,cAAc,EAAE;AAC3B,IAAI,cAAc,CAAC,iBAAiB,CAAC,GAAG,iBAAiB;AACzD,IAAI,cAAc,CAAC,kBAAkB,CAAC,GAAG,sBAAsB;AAC/D,CAAC,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,GAAG,cAAc,GAAG,EAAE,CAAC,CAAC;;"}
@@ -4,6 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.AuthValidationErrorCode = void 0;
7
+ var AuthValidationErrorCode;
7
8
  (function (AuthValidationErrorCode) {
8
9
  AuthValidationErrorCode["EmptySignInUsername"] = "EmptySignInUsername";
9
10
  AuthValidationErrorCode["EmptySignInPassword"] = "EmptySignInPassword";
@@ -22,5 +23,5 @@ exports.AuthValidationErrorCode = void 0;
22
23
  AuthValidationErrorCode["EmptyConfirmUserAttributeCode"] = "EmptyConfirmUserAttributeCode";
23
24
  AuthValidationErrorCode["IncorrectMFAMethod"] = "IncorrectMFAMethod";
24
25
  AuthValidationErrorCode["EmptyUpdatePassword"] = "EmptyUpdatePassword";
25
- })(exports.AuthValidationErrorCode || (exports.AuthValidationErrorCode = {}));
26
+ })(AuthValidationErrorCode || (exports.AuthValidationErrorCode = AuthValidationErrorCode = {}));
26
27
  //# sourceMappingURL=validation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validation.js","sources":["../../../../src/errors/types/validation.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.AuthValidationErrorCode = void 0;\nvar AuthValidationErrorCode;\n(function (AuthValidationErrorCode) {\n AuthValidationErrorCode[\"EmptySignInUsername\"] = \"EmptySignInUsername\";\n AuthValidationErrorCode[\"EmptySignInPassword\"] = \"EmptySignInPassword\";\n AuthValidationErrorCode[\"CustomAuthSignInPassword\"] = \"CustomAuthSignInPassword\";\n AuthValidationErrorCode[\"EmptySignUpUsername\"] = \"EmptySignUpUsername\";\n AuthValidationErrorCode[\"EmptySignUpPassword\"] = \"EmptySignUpPassword\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpUsername\"] = \"EmptyConfirmSignUpUsername\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpCode\"] = \"EmptyConfirmSignUpCode\";\n AuthValidationErrorCode[\"EmptyResendSignUpCodeUsername\"] = \"EmptyresendSignUpCodeUsername\";\n AuthValidationErrorCode[\"EmptyChallengeResponse\"] = \"EmptyChallengeResponse\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordUsername\"] = \"EmptyConfirmResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordNewPassword\"] = \"EmptyConfirmResetPasswordNewPassword\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordConfirmationCode\"] = \"EmptyConfirmResetPasswordConfirmationCode\";\n AuthValidationErrorCode[\"EmptyResetPasswordUsername\"] = \"EmptyResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyVerifyTOTPSetupCode\"] = \"EmptyVerifyTOTPSetupCode\";\n AuthValidationErrorCode[\"EmptyConfirmUserAttributeCode\"] = \"EmptyConfirmUserAttributeCode\";\n AuthValidationErrorCode[\"IncorrectMFAMethod\"] = \"IncorrectMFAMethod\";\n AuthValidationErrorCode[\"EmptyUpdatePassword\"] = \"EmptyUpdatePassword\";\n})(AuthValidationErrorCode = exports.AuthValidationErrorCode || (exports.AuthValidationErrorCode = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,MAAM;AAExC,CAAC,UAAU,uBAAuB,EAAE;AACpC,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,4BAA4B,CAAC,GAAG,4BAA4B;AACxF,IAAI,uBAAuB,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAChF,IAAI,uBAAuB,CAAC,+BAA+B,CAAC,GAAG,+BAA+B;AAC9F,IAAI,uBAAuB,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAChF,IAAI,uBAAuB,CAAC,mCAAmC,CAAC,GAAG,mCAAmC;AACtG,IAAI,uBAAuB,CAAC,sCAAsC,CAAC,GAAG,sCAAsC;AAC5G,IAAI,uBAAuB,CAAC,2CAA2C,CAAC,GAAG,2CAA2C;AACtH,IAAI,uBAAuB,CAAC,4BAA4B,CAAC,GAAG,4BAA4B;AACxF,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,IAAI,uBAAuB,CAAC,+BAA+B,CAAC,GAAG,+BAA+B;AAC9F,IAAI,uBAAuB,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;AACxE,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,CAAC,EAA4B,OAAO,CAAC,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAC;;"}
1
+ {"version":3,"file":"validation.js","sources":["../../../../src/errors/types/validation.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.AuthValidationErrorCode = void 0;\nvar AuthValidationErrorCode;\n(function (AuthValidationErrorCode) {\n AuthValidationErrorCode[\"EmptySignInUsername\"] = \"EmptySignInUsername\";\n AuthValidationErrorCode[\"EmptySignInPassword\"] = \"EmptySignInPassword\";\n AuthValidationErrorCode[\"CustomAuthSignInPassword\"] = \"CustomAuthSignInPassword\";\n AuthValidationErrorCode[\"EmptySignUpUsername\"] = \"EmptySignUpUsername\";\n AuthValidationErrorCode[\"EmptySignUpPassword\"] = \"EmptySignUpPassword\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpUsername\"] = \"EmptyConfirmSignUpUsername\";\n AuthValidationErrorCode[\"EmptyConfirmSignUpCode\"] = \"EmptyConfirmSignUpCode\";\n AuthValidationErrorCode[\"EmptyResendSignUpCodeUsername\"] = \"EmptyresendSignUpCodeUsername\";\n AuthValidationErrorCode[\"EmptyChallengeResponse\"] = \"EmptyChallengeResponse\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordUsername\"] = \"EmptyConfirmResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordNewPassword\"] = \"EmptyConfirmResetPasswordNewPassword\";\n AuthValidationErrorCode[\"EmptyConfirmResetPasswordConfirmationCode\"] = \"EmptyConfirmResetPasswordConfirmationCode\";\n AuthValidationErrorCode[\"EmptyResetPasswordUsername\"] = \"EmptyResetPasswordUsername\";\n AuthValidationErrorCode[\"EmptyVerifyTOTPSetupCode\"] = \"EmptyVerifyTOTPSetupCode\";\n AuthValidationErrorCode[\"EmptyConfirmUserAttributeCode\"] = \"EmptyConfirmUserAttributeCode\";\n AuthValidationErrorCode[\"IncorrectMFAMethod\"] = \"IncorrectMFAMethod\";\n AuthValidationErrorCode[\"EmptyUpdatePassword\"] = \"EmptyUpdatePassword\";\n})(AuthValidationErrorCode || (exports.AuthValidationErrorCode = AuthValidationErrorCode = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,MAAM;AACxC,IAAI,uBAAuB;AAC3B,CAAC,UAAU,uBAAuB,EAAE;AACpC,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,IAAI,uBAAuB,CAAC,4BAA4B,CAAC,GAAG,4BAA4B;AACxF,IAAI,uBAAuB,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAChF,IAAI,uBAAuB,CAAC,+BAA+B,CAAC,GAAG,+BAA+B;AAC9F,IAAI,uBAAuB,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAChF,IAAI,uBAAuB,CAAC,mCAAmC,CAAC,GAAG,mCAAmC;AACtG,IAAI,uBAAuB,CAAC,sCAAsC,CAAC,GAAG,sCAAsC;AAC5G,IAAI,uBAAuB,CAAC,2CAA2C,CAAC,GAAG,2CAA2C;AACtH,IAAI,uBAAuB,CAAC,4BAA4B,CAAC,GAAG,4BAA4B;AACxF,IAAI,uBAAuB,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AACpF,IAAI,uBAAuB,CAAC,+BAA+B,CAAC,GAAG,+BAA+B;AAC9F,IAAI,uBAAuB,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;AACxE,IAAI,uBAAuB,CAAC,qBAAqB,CAAC,GAAG,qBAAqB;AAC1E,CAAC,EAAE,uBAAuB,KAAK,OAAO,CAAC,uBAAuB,GAAG,uBAAuB,GAAG,EAAE,CAAC,CAAC;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.assertServiceError = void 0;
6
+ exports.assertServiceError = assertServiceError;
7
7
  const utils_1 = require("@aws-amplify/core/internals/utils");
8
8
  const AuthError_1 = require("../AuthError");
9
9
  function assertServiceError(error) {
@@ -17,5 +17,4 @@ function assertServiceError(error) {
17
17
  });
18
18
  }
19
19
  }
20
- exports.assertServiceError = assertServiceError;
21
20
  //# sourceMappingURL=assertServiceError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertServiceError.js","sources":["../../../../src/errors/utils/assertServiceError.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.assertServiceError = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst AuthError_1 = require(\"../AuthError\");\nfunction assertServiceError(error) {\n if (!error ||\n error.name === 'Error' ||\n error instanceof TypeError) {\n throw new AuthError_1.AuthError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: error,\n });\n }\n}\nexports.assertServiceError = assertServiceError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,MAAM;AACnC,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,SAAS,kBAAkB,CAAC,KAAK,EAAE;AACnC,IAAI,IAAI,CAAC,KAAK;AACd,QAAQ,KAAK,CAAC,IAAI,KAAK,OAAO;AAC9B,QAAQ,KAAK,YAAY,SAAS,EAAE;AACpC,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,eAAe,EAAE,KAAK;AAClC,SAAS,CAAC;AACV;AACA;AACA,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;;"}
1
+ {"version":3,"file":"assertServiceError.js","sources":["../../../../src/errors/utils/assertServiceError.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.assertServiceError = assertServiceError;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst AuthError_1 = require(\"../AuthError\");\nfunction assertServiceError(error) {\n if (!error ||\n error.name === 'Error' ||\n error instanceof TypeError) {\n throw new AuthError_1.AuthError({\n name: utils_1.AmplifyErrorCode.Unknown,\n message: 'An unknown error has occurred.',\n underlyingError: error,\n });\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,kBAAkB,GAAG,kBAAkB;AAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,SAAS,kBAAkB,CAAC,KAAK,EAAE;AACnC,IAAI,IAAI,CAAC,KAAK;AACd,QAAQ,KAAK,CAAC,IAAI,KAAK,OAAO;AAC9B,QAAQ,KAAK,YAAY,SAAS,EAAE;AACpC,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAAC,OAAO;AAClD,YAAY,OAAO,EAAE,gCAAgC;AACrD,YAAY,eAAe,EAAE,KAAK;AAClC,SAAS,CAAC;AACV;AACA;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.assertValidationError = void 0;
6
+ exports.assertValidationError = assertValidationError;
7
7
  const AuthErrorStrings_1 = require("../../common/AuthErrorStrings");
8
8
  const AuthError_1 = require("../AuthError");
9
9
  function assertValidationError(assertion, name) {
@@ -12,5 +12,4 @@ function assertValidationError(assertion, name) {
12
12
  throw new AuthError_1.AuthError({ name, message, recoverySuggestion });
13
13
  }
14
14
  }
15
- exports.assertValidationError = assertValidationError;
16
15
  //# sourceMappingURL=assertValidationError.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"assertValidationError.js","sources":["../../../../src/errors/utils/assertValidationError.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.assertValidationError = void 0;\nconst AuthErrorStrings_1 = require(\"../../common/AuthErrorStrings\");\nconst AuthError_1 = require(\"../AuthError\");\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = AuthErrorStrings_1.validationErrorMap[name];\n if (!assertion) {\n throw new AuthError_1.AuthError({ name, message, recoverySuggestion });\n }\n}\nexports.assertValidationError = assertValidationError;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,MAAM;AACtC,MAAM,kBAAkB,GAAG,OAAO,CAAC,+BAA+B,CAAC;AACnE,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,IAAI,CAAC;AACvF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9E;AACA;AACA,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;;"}
1
+ {"version":3,"file":"assertValidationError.js","sources":["../../../../src/errors/utils/assertValidationError.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.assertValidationError = assertValidationError;\nconst AuthErrorStrings_1 = require(\"../../common/AuthErrorStrings\");\nconst AuthError_1 = require(\"../AuthError\");\nfunction assertValidationError(assertion, name) {\n const { message, recoverySuggestion } = AuthErrorStrings_1.validationErrorMap[name];\n if (!assertion) {\n throw new AuthError_1.AuthError({ name, message, recoverySuggestion });\n }\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,qBAAqB,GAAG,qBAAqB;AACrD,MAAM,kBAAkB,GAAG,OAAO,CAAC,+BAA+B,CAAC;AACnE,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,SAAS,qBAAqB,CAAC,SAAS,EAAE,IAAI,EAAE;AAChD,IAAI,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAG,kBAAkB,CAAC,kBAAkB,CAAC,IAAI,CAAC;AACvF,IAAI,IAAI,CAAC,SAAS,EAAE;AACpB,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AAC9E;AACA;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.deleteWebAuthnCredential = void 0;
6
+ exports.deleteWebAuthnCredential = deleteWebAuthnCredential;
7
7
  const utils_1 = require("@aws-amplify/core/internals/utils");
8
8
  const types_1 = require("../../providers/cognito/utils/types");
9
9
  const factories_1 = require("../../providers/cognito/factories");
@@ -29,5 +29,4 @@ async function deleteWebAuthnCredential(amplify, input) {
29
29
  CredentialId: input.credentialId,
30
30
  });
31
31
  }
32
- exports.deleteWebAuthnCredential = deleteWebAuthnCredential;
33
32
  //# sourceMappingURL=deleteWebAuthnCredential.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deleteWebAuthnCredential.js","sources":["../../../../src/foundation/apis/deleteWebAuthnCredential.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.deleteWebAuthnCredential = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst types_1 = require(\"../../providers/cognito/utils/types\");\nconst factories_1 = require(\"../../providers/cognito/factories\");\nconst parsers_1 = require(\"../parsers\");\nconst utils_2 = require(\"../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../factories/serviceClients/cognitoIdentityProvider\");\nasync function deleteWebAuthnCredential(amplify, input) {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await amplify.Auth.fetchAuthSession();\n (0, types_1.assertAuthTokens)(tokens);\n const deleteWebAuthnCredentialResult = (0, cognitoIdentityProvider_1.createDeleteWebAuthnCredentialClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await deleteWebAuthnCredentialResult({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.DeleteWebAuthnCredential),\n }, {\n AccessToken: tokens.accessToken.toString(),\n CredentialId: input.credentialId,\n });\n}\nexports.deleteWebAuthnCredential = deleteWebAuthnCredential;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,MAAM;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAChE,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,yBAAyB,GAAG,OAAO,CAAC,qDAAqD,CAAC;AAChG,eAAe,wBAAwB,CAAC,OAAO,EAAE,KAAK,EAAE;AACxD,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO;AACxD,IAAI,IAAI,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC;AACtD,IAAI,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,UAAU;AACvD,IAAI,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AAC5D,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC;AACzC,IAAI,MAAM,8BAA8B,GAAG,IAAI,yBAAyB,CAAC,oCAAoC,EAAE;AAC/G,QAAQ,gBAAgB,EAAE,IAAI,WAAW,CAAC,qCAAqC,EAAE;AACjF,YAAY,gBAAgB,EAAE,gBAAgB;AAC9C,SAAS,CAAC;AACV,KAAK,CAAC;AACN,IAAI,MAAM,8BAA8B,CAAC;AACzC,QAAQ,MAAM,EAAE,IAAI,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC;AAClE,QAAQ,cAAc,EAAE,IAAI,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;AACvG,KAAK,EAAE;AACP,QAAQ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;AAClD,QAAQ,YAAY,EAAE,KAAK,CAAC,YAAY;AACxC,KAAK,CAAC;AACN;AACA,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;;"}
1
+ {"version":3,"file":"deleteWebAuthnCredential.js","sources":["../../../../src/foundation/apis/deleteWebAuthnCredential.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.deleteWebAuthnCredential = deleteWebAuthnCredential;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst types_1 = require(\"../../providers/cognito/utils/types\");\nconst factories_1 = require(\"../../providers/cognito/factories\");\nconst parsers_1 = require(\"../parsers\");\nconst utils_2 = require(\"../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../factories/serviceClients/cognitoIdentityProvider\");\nasync function deleteWebAuthnCredential(amplify, input) {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await amplify.Auth.fetchAuthSession();\n (0, types_1.assertAuthTokens)(tokens);\n const deleteWebAuthnCredentialResult = (0, cognitoIdentityProvider_1.createDeleteWebAuthnCredentialClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await deleteWebAuthnCredentialResult({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.DeleteWebAuthnCredential),\n }, {\n AccessToken: tokens.accessToken.toString(),\n CredentialId: input.credentialId,\n });\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,wBAAwB,GAAG,wBAAwB;AAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAChE,MAAM,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC;AACvC,MAAM,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;AACtC,MAAM,yBAAyB,GAAG,OAAO,CAAC,qDAAqD,CAAC;AAChG,eAAe,wBAAwB,CAAC,OAAO,EAAE,KAAK,EAAE;AACxD,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO;AACxD,IAAI,IAAI,OAAO,CAAC,yBAAyB,EAAE,UAAU,CAAC;AACtD,IAAI,MAAM,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,UAAU;AACvD,IAAI,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE;AAC5D,IAAI,IAAI,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC;AACzC,IAAI,MAAM,8BAA8B,GAAG,IAAI,yBAAyB,CAAC,oCAAoC,EAAE;AAC/G,QAAQ,gBAAgB,EAAE,IAAI,WAAW,CAAC,qCAAqC,EAAE;AACjF,YAAY,gBAAgB,EAAE,gBAAgB;AAC9C,SAAS,CAAC;AACV,KAAK,CAAC;AACN,IAAI,MAAM,8BAA8B,CAAC;AACzC,QAAQ,MAAM,EAAE,IAAI,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC;AAClE,QAAQ,cAAc,EAAE,IAAI,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,UAAU,CAAC,wBAAwB,CAAC;AACvG,KAAK,EAAE;AACP,QAAQ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;AAClD,QAAQ,YAAY,EAAE,KAAK,CAAC,YAAY;AACxC,KAAK,CAAC;AACN;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.listWebAuthnCredentials = void 0;
6
+ exports.listWebAuthnCredentials = listWebAuthnCredentials;
7
7
  const utils_1 = require("@aws-amplify/core/internals/utils");
8
8
  const types_1 = require("../../providers/cognito/utils/types");
9
9
  const factories_1 = require("../../providers/cognito/factories");
@@ -42,5 +42,4 @@ async function listWebAuthnCredentials(amplify, input) {
42
42
  nextToken,
43
43
  };
44
44
  }
45
- exports.listWebAuthnCredentials = listWebAuthnCredentials;
46
45
  //# sourceMappingURL=listWebAuthnCredentials.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listWebAuthnCredentials.js","sources":["../../../../src/foundation/apis/listWebAuthnCredentials.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.listWebAuthnCredentials = void 0;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst types_1 = require(\"../../providers/cognito/utils/types\");\nconst factories_1 = require(\"../../providers/cognito/factories\");\nconst parsers_1 = require(\"../parsers\");\nconst utils_2 = require(\"../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../factories/serviceClients/cognitoIdentityProvider\");\nasync function listWebAuthnCredentials(amplify, input) {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await amplify.Auth.fetchAuthSession();\n (0, types_1.assertAuthTokens)(tokens);\n const listWebAuthnCredentialsResult = (0, cognitoIdentityProvider_1.createListWebAuthnCredentialsClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { Credentials: commandCredentials = [], NextToken: nextToken } = await listWebAuthnCredentialsResult({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.ListWebAuthnCredentials),\n }, {\n AccessToken: tokens.accessToken.toString(),\n MaxResults: input?.pageSize,\n NextToken: input?.nextToken,\n });\n const credentials = commandCredentials.map(item => ({\n credentialId: item.CredentialId,\n friendlyCredentialName: item.FriendlyCredentialName,\n relyingPartyId: item.RelyingPartyId,\n authenticatorAttachment: item.AuthenticatorAttachment,\n authenticatorTransports: item.AuthenticatorTransports,\n createdAt: item.CreatedAt ? new Date(item.CreatedAt * 1000) : undef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C;AAC/G,QAAQ,MAAM,EAAE,IAAI,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC;AAClE,QAAQ,cAAc,EAAE,IAAI,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,UAAU,CAAC,uBAAuB,CAAC;AACtG,KAAK,EAAE;AACP,QAAQ,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,QAAQ,EAAE;AAClD,QAAQ,UAAU,EAAE,KAAK,EAAE,QAAQ;AACnC,QAAQ,SAAS,EAAE,KAAK,EAAE,SAAS;AACnC,KAAK,CAAC;AACN,IAAI,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,IAAI,KAAK;AACxD,QAAQ,YAAY,EAAE,IAAI,CAAC,YAAY;AACvC,QAAQ,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;AAC3D,QAAQ,cAAc,EAAE,IAAI,CAAC,cAAc;AAC3C,QAAQ,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;AAC7D,QAAQ,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;AAC7D,QAAQ,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS;AAC/E,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,SAAS;AACjB,KAAK;AACL;AACA,OAAO,CAAC,uBAAuB,GAAG,uBAAuB;;"}
1
+ {"version":3,"file":"listWebAuthnCredentials.js","sources":["../../../../src/foundation/apis/listWebAuthnCredentials.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.listWebAuthnCredentials = listWebAuthnCredentials;\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst types_1 = require(\"../../providers/cognito/utils/types\");\nconst factories_1 = require(\"../../providers/cognito/factories\");\nconst parsers_1 = require(\"../parsers\");\nconst utils_2 = require(\"../../utils\");\nconst cognitoIdentityProvider_1 = require(\"../factories/serviceClients/cognitoIdentityProvider\");\nasync function listWebAuthnCredentials(amplify, input) {\n const authConfig = amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolEndpoint, userPoolId } = authConfig;\n const { tokens } = await amplify.Auth.fetchAuthSession();\n (0, types_1.assertAuthTokens)(tokens);\n const listWebAuthnCredentialsResult = (0, cognitoIdentityProvider_1.createListWebAuthnCredentialsClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n const { Credentials: commandCredentials = [], NextToken: nextToken } = await listWebAuthnCredentialsResult({\n region: (0, parsers_1.getRegionFromUserPoolId)(userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.ListWebAuthnCredentials),\n }, {\n AccessToken: tokens.accessToken.toString(),\n MaxResults: input?.pageSize,\n NextToken: input?.nextToken,\n });\n const credentials = commandCredentials.map(item => ({\n credentialId: item.CredentialId,\n friendlyCredentialName: item.FriendlyCredentialName,\n relyingPartyId: item.RelyingPartyId,\n authenticatorAttachment: item.AuthenticatorAttachment,\n authenticatorTransports: item.AuthenticatorTransports,\n createdAt: item.CreatedAt ? new Date(item.CreatedAt * 1000) : undefined,\n }));\n return {\n credentials,\n nextToken,\n };\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,uBAAuB;AACzD,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,qCAAqC,CAAC;AAC9D,MAAM,WAAW,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAChE,MA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B,CAAC,GAAG,CAAC,IAAI,KAAK;AACxD,QAAQ,YAAY,EAAE,IAAI,CAAC,YAAY;AACvC,QAAQ,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;AAC3D,QAAQ,cAAc,EAAE,IAAI,CAAC,cAAc;AAC3C,QAAQ,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;AAC7D,QAAQ,uBAAuB,EAAE,IAAI,CAAC,uBAAuB;AAC7D,QAAQ,SAAS,EAAE,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,GAAG,SAAS;AAC/E,KAAK,CAAC,CAAC;AACP,IAAI,OAAO;AACX,QAAQ,WAAW;AACnB,QAAQ,SAAS;AACjB,KAAK;AACL;;"}
@@ -4,6 +4,7 @@
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.DeleteWebAuthnCredentialException = exports.ListWebAuthnCredentialsException = exports.CompleteWebAuthnRegistrationException = exports.StartWebAuthnRegistrationException = void 0;
7
+ var StartWebAuthnRegistrationException;
7
8
  (function (StartWebAuthnRegistrationException) {
8
9
  StartWebAuthnRegistrationException["ForbiddenException"] = "ForbiddenException";
9
10
  StartWebAuthnRegistrationException["InternalErrorException"] = "InternalErrorException";
@@ -13,7 +14,8 @@ exports.DeleteWebAuthnCredentialException = exports.ListWebAuthnCredentialsExcep
13
14
  StartWebAuthnRegistrationException["TooManyRequestsException"] = "TooManyRequestsException";
14
15
  StartWebAuthnRegistrationException["WebAuthnNotEnabledException"] = "WebAuthnNotEnabledException";
15
16
  StartWebAuthnRegistrationException["WebAuthnConfigurationMissingException"] = "WebAuthnConfigurationMissingException";
16
- })(exports.StartWebAuthnRegistrationException || (exports.StartWebAuthnRegistrationException = {}));
17
+ })(StartWebAuthnRegistrationException || (exports.StartWebAuthnRegistrationException = StartWebAuthnRegistrationException = {}));
18
+ var CompleteWebAuthnRegistrationException;
17
19
  (function (CompleteWebAuthnRegistrationException) {
18
20
  CompleteWebAuthnRegistrationException["ForbiddenException"] = "ForbiddenException";
19
21
  CompleteWebAuthnRegistrationException["InternalErrorException"] = "InternalErrorException";
@@ -27,18 +29,20 @@ exports.DeleteWebAuthnCredentialException = exports.ListWebAuthnCredentialsExcep
27
29
  CompleteWebAuthnRegistrationException["WebAuthnClientMismatchException"] = "WebAuthnClientMismatchException";
28
30
  CompleteWebAuthnRegistrationException["WebAuthnOriginNotAllowedException"] = "WebAuthnOriginNotAllowedException";
29
31
  CompleteWebAuthnRegistrationException["WebAuthnCredentialNotSupportedException"] = "WebAuthnCredentialNotSupportedException";
30
- })(exports.CompleteWebAuthnRegistrationException || (exports.CompleteWebAuthnRegistrationException = {}));
32
+ })(CompleteWebAuthnRegistrationException || (exports.CompleteWebAuthnRegistrationException = CompleteWebAuthnRegistrationException = {}));
33
+ var ListWebAuthnCredentialsException;
31
34
  (function (ListWebAuthnCredentialsException) {
32
35
  ListWebAuthnCredentialsException["ForbiddenException"] = "ForbiddenException";
33
36
  ListWebAuthnCredentialsException["InternalErrorException"] = "InternalErrorException";
34
37
  ListWebAuthnCredentialsException["InvalidParameterException"] = "InvalidParameterException";
35
38
  ListWebAuthnCredentialsException["NotAuthorizedException"] = "NotAuthorizedException";
36
- })(exports.ListWebAuthnCredentialsException || (exports.ListWebAuthnCredentialsException = {}));
39
+ })(ListWebAuthnCredentialsException || (exports.ListWebAuthnCredentialsException = ListWebAuthnCredentialsException = {}));
40
+ var DeleteWebAuthnCredentialException;
37
41
  (function (DeleteWebAuthnCredentialException) {
38
42
  DeleteWebAuthnCredentialException["ForbiddenException"] = "ForbiddenException";
39
43
  DeleteWebAuthnCredentialException["InternalErrorException"] = "InternalErrorException";
40
44
  DeleteWebAuthnCredentialException["InvalidParameterException"] = "InvalidParameterException";
41
45
  DeleteWebAuthnCredentialException["NotAuthorizedException"] = "NotAuthorizedException";
42
46
  DeleteWebAuthnCredentialException["ResourceNotFoundException"] = "ResourceNotFoundException";
43
- })(exports.DeleteWebAuthnCredentialException || (exports.DeleteWebAuthnCredentialException = {}));
47
+ })(DeleteWebAuthnCredentialException || (exports.DeleteWebAuthnCredentialException = DeleteWebAuthnCredentialException = {}));
44
48
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sources":["../../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.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.DeleteWebAuthnCredentialException = exports.ListWebAuthnCredentialsException = exports.CompleteWebAuthnRegistrationException = exports.StartWebAuthnRegistrationException = void 0;\nvar StartWebAuthnRegistrationException;\n(function (StartWebAuthnRegistrationException) {\n StartWebAuthnRegistrationException[\"ForbiddenException\"] = \"ForbiddenException\";\n StartWebAuthnRegistrationException[\"InternalErrorException\"] = \"InternalErrorException\";\n StartWebAuthnRegistrationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n StartWebAuthnRegistrationException[\"LimitExceededException\"] = \"LimitExceededException\";\n StartWebAuthnRegistrationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n StartWebAuthnRegistrationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n StartWebAuthnRegistrationException[\"WebAuthnNotEnabledException\"] = \"WebAuthnNotEnabledException\";\n StartWebAuthnRegistrationException[\"WebAuthnConfigurationMissingException\"] = \"WebAuthnConfigurationMissingException\";\n})(StartWebAuthnRegistrationException = exports.StartWebAuthnRegistrationException || (exports.StartWebAuthnRegistrationException = {}));\nvar CompleteWebAuthnRegistrationException;\n(function (CompleteWebAuthnRegistrationException) {\n CompleteWebAuthnRegistrationException[\"ForbiddenException\"] = \"ForbiddenException\";\n CompleteWebAuthnRegistrationException[\"InternalErrorException\"] = \"InternalErrorException\";\n CompleteWebAuthnRegistrationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n CompleteWebAuthnRegistrationException[\"LimitExceededException\"] = \"LimitExceededException\";\n CompleteWebAuthnRegistrationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n CompleteWebAuthnRegistrationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnNotEnabledException\"] = \"WebAuthnNotEnabledException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnChallengeNotFoundException\"] = \"WebAuthnChallengeNotFoundException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnRelyingPartyMismatchException\"] = \"WebAuthnRelyingPartyMismatchException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnClientMismatchException\"] = \"WebAuthnClientMismatchException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnOriginNotAllowedException\"] = \"WebAuthnOriginNotAllowedException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnCredentialNotSupportedException\"] = \"WebAuthnCredentialNotSupportedException\";\n})(CompleteWebAuthnRegistrationException = exports.CompleteWebAuthnRegistrationException || (exports.CompleteWebAuthnRegistrationException = {}));\nvar ListWebAuthnCredentialsException;\n(function (ListWebAuthnCredentialsException) {\n ListWebAuthnCredentialsException[\"ForbiddenException\"] = \"ForbiddenException\";\n ListWebAuthnCredentialsException[\"InternalErrorException\"] = \"InternalErrorException\";\n ListWebAuthnCredentialsException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ListWebAuthnCredentialsException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n})(ListWebAuthnCredentialsException = exports.ListWebAuthnCredentialsException || (exports.ListWebAuthnCredentialsException = {}));\nvar DeleteWebAuthnCredentialException;\n(function (DeleteWebAuthnCredentialException) {\n DeleteWebAuthnCredentialException[\"ForbiddenException\"] = \"ForbiddenException\";\n DeleteWebAuthnCredentialException[\"InternalErrorException\"] = \"InternalErrorException\";\n DeleteWebAuthnCredentialException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n DeleteWebAuthnCredentialException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n DeleteWebAuthnCredentialException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n})(DeleteWebAuthnCredentialException = exports.DeleteWebAuthnCredentialException || (exports.DeleteWebAuthnCredentialException = {}));\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,iCAAiC,GAAG,OAAO,CAAC,gCAAgC,GAAG,OAAO,CAAC,qCAAqC,GAAG,OAAO,CAAC,kCAAkC,GAAG,MAAM;AAE1L,CAAC,UAAU,kCAAkC,EAAE;AAC/C,IAAI,kCAAkC,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;AACnF,IAAI,kCAAkC,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAC3F,IAAI,kCAAkC,CAAC,2BAA2B,CAAC,GAAG,2BAA2B;AACjG,IAAI,kCAAkC,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAC3F,IAAI,kCAAkC,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAC3F,IAAI,kCAAkC,CAAC,0BAA0B,CAAC,GAAG,0BAA0B;AAC/F,IAAI,kCAAkC,CAAC,6BAA6B,CAAC,GAAG,6BAA6B;AACrG,IAAI,kCAAkC,CAAC,uCAAuC,CAAC,GAAG,uCAAuC;AACzH,CAAC,EAAuC,OAAO,CAAC,kCAAkC,KAAK,OAAO,CAAC,kCAAkC,GAAG,EAAE,CAAC,CAAC;AAExI,CAAC,UAAU,qCAAqC,EAAE;AAClD,IAAI,qCAAqC,CAAC,oBAAoB,CAAC,GAAG,oBAAoB;AACtF,IAAI,qCAAqC,CAAC,wBAAwB,CAAC,GAAG,wBAAwB;AAC9F,IAAI,qCAAqC,CAAC,2BAA2B,CAAC,GAAG,2BAA2B;AACpG,IAAI,qCAAqC,CAAC,wBAAwB,CAAC,G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AAO,CAAC,iCAAiC,KAAK,OAAO,CAAC,iCAAiC,GAAG,EAAE,CAAC,CAAC;;"}
1
+ {"version":3,"file":"errors.js","sources":["../../../../../../../src/foundation/factories/serviceClients/cognitoIdentityProvider/types/errors.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.DeleteWebAuthnCredentialException = exports.ListWebAuthnCredentialsException = exports.CompleteWebAuthnRegistrationException = exports.StartWebAuthnRegistrationException = void 0;\nvar StartWebAuthnRegistrationException;\n(function (StartWebAuthnRegistrationException) {\n StartWebAuthnRegistrationException[\"ForbiddenException\"] = \"ForbiddenException\";\n StartWebAuthnRegistrationException[\"InternalErrorException\"] = \"InternalErrorException\";\n StartWebAuthnRegistrationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n StartWebAuthnRegistrationException[\"LimitExceededException\"] = \"LimitExceededException\";\n StartWebAuthnRegistrationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n StartWebAuthnRegistrationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n StartWebAuthnRegistrationException[\"WebAuthnNotEnabledException\"] = \"WebAuthnNotEnabledException\";\n StartWebAuthnRegistrationException[\"WebAuthnConfigurationMissingException\"] = \"WebAuthnConfigurationMissingException\";\n})(StartWebAuthnRegistrationException || (exports.StartWebAuthnRegistrationException = StartWebAuthnRegistrationException = {}));\nvar CompleteWebAuthnRegistrationException;\n(function (CompleteWebAuthnRegistrationException) {\n CompleteWebAuthnRegistrationException[\"ForbiddenException\"] = \"ForbiddenException\";\n CompleteWebAuthnRegistrationException[\"InternalErrorException\"] = \"InternalErrorException\";\n CompleteWebAuthnRegistrationException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n CompleteWebAuthnRegistrationException[\"LimitExceededException\"] = \"LimitExceededException\";\n CompleteWebAuthnRegistrationException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n CompleteWebAuthnRegistrationException[\"TooManyRequestsException\"] = \"TooManyRequestsException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnNotEnabledException\"] = \"WebAuthnNotEnabledException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnChallengeNotFoundException\"] = \"WebAuthnChallengeNotFoundException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnRelyingPartyMismatchException\"] = \"WebAuthnRelyingPartyMismatchException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnClientMismatchException\"] = \"WebAuthnClientMismatchException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnOriginNotAllowedException\"] = \"WebAuthnOriginNotAllowedException\";\n CompleteWebAuthnRegistrationException[\"WebAuthnCredentialNotSupportedException\"] = \"WebAuthnCredentialNotSupportedException\";\n})(CompleteWebAuthnRegistrationException || (exports.CompleteWebAuthnRegistrationException = CompleteWebAuthnRegistrationException = {}));\nvar ListWebAuthnCredentialsException;\n(function (ListWebAuthnCredentialsException) {\n ListWebAuthnCredentialsException[\"ForbiddenException\"] = \"ForbiddenException\";\n ListWebAuthnCredentialsException[\"InternalErrorException\"] = \"InternalErrorException\";\n ListWebAuthnCredentialsException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n ListWebAuthnCredentialsException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n})(ListWebAuthnCredentialsException || (exports.ListWebAuthnCredentialsException = ListWebAuthnCredentialsException = {}));\nvar DeleteWebAuthnCredentialException;\n(function (DeleteWebAuthnCredentialException) {\n DeleteWebAuthnCredentialException[\"ForbiddenException\"] = \"ForbiddenException\";\n DeleteWebAuthnCredentialException[\"InternalErrorException\"] = \"InternalErrorException\";\n DeleteWebAuthnCredentialException[\"InvalidParameterException\"] = \"InvalidParameterException\";\n DeleteWebAuthnCredentialException[\"NotAuthorizedException\"] = \"NotAuthorizedException\";\n DeleteWebAuthnCredentialException[\"ResourceNotFoundException\"] = \"ResourceNotFoundException\";\n})(DeleteWebAuthn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AiC,GAAG,EAAE,CAAC,CAAC;;"}
@@ -1,7 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.getRegionFromIdentityPoolId = exports.getRegionFromUserPoolId = void 0;
4
+ exports.getRegionFromUserPoolId = getRegionFromUserPoolId;
5
+ exports.getRegionFromIdentityPoolId = getRegionFromIdentityPoolId;
5
6
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
6
7
  // SPDX-License-Identifier: Apache-2.0
7
8
  const AuthError_1 = require("../../errors/AuthError");
@@ -17,7 +18,6 @@ function getRegionFromUserPoolId(userPoolId) {
17
18
  });
18
19
  return region;
19
20
  }
20
- exports.getRegionFromUserPoolId = getRegionFromUserPoolId;
21
21
  function getRegionFromIdentityPoolId(identityPoolId) {
22
22
  if (!identityPoolId || !identityPoolId.includes(':')) {
23
23
  throw new AuthError_1.AuthError({
@@ -28,5 +28,4 @@ function getRegionFromIdentityPoolId(identityPoolId) {
28
28
  }
29
29
  return identityPoolId.split(':')[0];
30
30
  }
31
- exports.getRegionFromIdentityPoolId = getRegionFromIdentityPoolId;
32
31
  //# sourceMappingURL=regionParsers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"regionParsers.js","sources":["../../../../src/foundation/parsers/regionParsers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRegionFromIdentityPoolId = exports.getRegionFromUserPoolId = void 0;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst AuthError_1 = require(\"../../errors/AuthError\");\nfunction getRegionFromUserPoolId(userPoolId) {\n const region = userPoolId?.split('_')[0];\n if (!userPoolId ||\n userPoolId.indexOf('_') < 0 ||\n !region ||\n typeof region !== 'string')\n throw new AuthError_1.AuthError({\n name: 'InvalidUserPoolId',\n message: 'Invalid user pool id provided.',\n });\n return region;\n}\nexports.getRegionFromUserPoolId = getRegionFromUserPoolId;\nfunction getRegionFromIdentityPoolId(identityPoolId) {\n if (!identityPoolId || !identityPoolId.includes(':')) {\n throw new AuthError_1.AuthError({\n name: 'InvalidIdentityPoolIdException',\n message: 'Invalid identity pool id provided.',\n recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',\n });\n }\n return identityPoolId.split(':')[0];\n}\nexports.getRegionFromIdentityPoolId = getRegionFromIdentityPoolId;\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,2BAA2B,GAAG,OAAO,CAAC,uBAAuB,GAAG,MAAM;AAC9E;AACA;AACA,MAAM,WAAW,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACrD,SAAS,uBAAuB,CAAC,UAAU,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5C,IAAI,IAAI,CAAC,UAAU;AACnB,QAAQ,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;AACnC,QAAQ,CAAC,MAAM;AACf,QAAQ,OAAO,MAAM,KAAK,QAAQ;AAClC,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,mBAAmB;AACrC,YAAY,OAAO,EAAE,gCAAgC;AACrD,SAAS,CAAC;AACV,IAAI,OAAO,MAAM;AACjB;AACA,OAAO,CAAC,uBAAuB,GAAG,uBAAuB;AACzD,SAAS,2BAA2B,CAAC,cAAc,EAAE;AACrD,IAAI,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1D,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,gCAAgC;AAClD,YAAY,OAAO,EAAE,oCAAoC;AACzD,YAAY,kBAAkB,EAAE,0DAA0D;AAC1F,SAAS,CAAC;AACV;AACA,IAAI,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC;AACA,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;;"}
1
+ {"version":3,"file":"regionParsers.js","sources":["../../../../src/foundation/parsers/regionParsers.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getRegionFromUserPoolId = getRegionFromUserPoolId;\nexports.getRegionFromIdentityPoolId = getRegionFromIdentityPoolId;\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nconst AuthError_1 = require(\"../../errors/AuthError\");\nfunction getRegionFromUserPoolId(userPoolId) {\n const region = userPoolId?.split('_')[0];\n if (!userPoolId ||\n userPoolId.indexOf('_') < 0 ||\n !region ||\n typeof region !== 'string')\n throw new AuthError_1.AuthError({\n name: 'InvalidUserPoolId',\n message: 'Invalid user pool id provided.',\n });\n return region;\n}\nfunction getRegionFromIdentityPoolId(identityPoolId) {\n if (!identityPoolId || !identityPoolId.includes(':')) {\n throw new AuthError_1.AuthError({\n name: 'InvalidIdentityPoolIdException',\n message: 'Invalid identity pool id provided.',\n recoverySuggestion: 'Make sure a valid identityPoolId is given in the config.',\n });\n }\n return identityPoolId.split(':')[0];\n}\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,uBAAuB,GAAG,uBAAuB;AACzD,OAAO,CAAC,2BAA2B,GAAG,2BAA2B;AACjE;AACA;AACA,MAAM,WAAW,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACrD,SAAS,uBAAuB,CAAC,UAAU,EAAE;AAC7C,IAAI,MAAM,MAAM,GAAG,UAAU,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5C,IAAI,IAAI,CAAC,UAAU;AACnB,QAAQ,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC;AACnC,QAAQ,CAAC,MAAM;AACf,QAAQ,OAAO,MAAM,KAAK,QAAQ;AAClC,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,mBAAmB;AACrC,YAAY,OAAO,EAAE,gCAAgC;AACrD,SAAS,CAAC;AACV,IAAI,OAAO,MAAM;AACjB;AACA,SAAS,2BAA2B,CAAC,cAAc,EAAE;AACrD,IAAI,IAAI,CAAC,cAAc,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AAC1D,QAAQ,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACxC,YAAY,IAAI,EAAE,gCAAgC;AAClD,YAAY,OAAO,EAAE,oCAAoC;AACzD,YAAY,kBAAkB,EAAE,0DAA0D;AAC1F,SAAS,CAAC;AACV;AACA,IAAI,OAAO,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACvC;;"}
@@ -3,7 +3,9 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.resetAutoSignIn = exports.setAutoSignIn = exports.autoSignIn = void 0;
6
+ exports.autoSignIn = void 0;
7
+ exports.setAutoSignIn = setAutoSignIn;
8
+ exports.resetAutoSignIn = resetAutoSignIn;
7
9
  const store_1 = require("../../../client/utils/store");
8
10
  const AuthError_1 = require("../../../errors/AuthError");
9
11
  const constants_1 = require("../../../errors/constants");
@@ -104,7 +106,6 @@ exports.autoSignIn = initialAutoSignIn;
104
106
  function setAutoSignIn(callback) {
105
107
  exports.autoSignIn = callback;
106
108
  }
107
- exports.setAutoSignIn = setAutoSignIn;
108
109
  /**
109
110
  * Resets the context
110
111
  *
@@ -116,5 +117,4 @@ function resetAutoSignIn(resetCallback = true) {
116
117
  }
117
118
  store_1.autoSignInStore.dispatch({ type: 'RESET' });
118
119
  }
119
- exports.resetAutoSignIn = resetAutoSignIn;
120
120
  //# sourceMappingURL=autoSignIn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"autoSignIn.js","sources":["../../../../../src/providers/cognito/apis/autoSignIn.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.resetAutoSignIn = exports.setAutoSignIn = exports.autoSignIn = void 0;\nconst store_1 = require(\"../../../client/utils/store\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst constants_1 = require(\"../../../errors/constants\");\nconst initialAutoSignIn = async () => {\n throw new AuthError_1.AuthError({\n name: constants_1.AUTO_SIGN_IN_EXCEPTION,\n message: 'The autoSignIn flow has not started, or has been cancelled/completed.',\n recoverySuggestion: 'Please try to use the signIn API or log out before starting a new autoSignIn flow.',\n });\n};\n/**\n * Signs a user in automatically after finishing the sign-up process.\n *\n * This API will automatically sign a user in if the autoSignIn flow has been completed in the following cases:\n * - User confirmed their account with a verification code sent to their phone or email (default option).\n * - User confirmed their account with a verification link sent to their phone or email. In order to\n * enable this option you need to go to the Amazon Cognito [console](https://aws.amazon.com/pm/cognito),\n * look for your userpool, then go to the `Messaging` tab and enable `link` mode inside the `Verification message` option.\n * Finally you need to define the `signUpVerificationMethod` in your `Auth` config.\n *\n * @example\n * ```typescript\n * Amplify.configure({\n * Auth: {\n * Cognito: {\n * ...cognitoConfig,\n * signUpVerificationMethod: \"link\" // the default value is \"code\"\n * }\n *\t}});\n * ```\n *\n * @throws AutoSignInException - Thrown when the autoSignIn flow has not started, or has been cancelled/completed.\n * @returns The signInOutput.\n *\n * @example\n * ```typescript\n * // handleSignUp.ts\n * async function handleSignUp(\n * username:string,\n * password:string\n * ){\n * try {\n * const { nextStep } = await signUp({\n * username,\n * password,\n * options: {\n * userAttributes:{ email:'email@email.com'},\n * autoSignIn: true // This enables the auto sign-in flow.\n * },\n * });\n *\n * handleSignUpStep(nextStep);\n *\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // handleConfirmSignUp.ts\n * async function handleConfirmSignUp(username:string, confirmationCode:string) {\n * try {\n * const { nextStep } = await confirmSignUp({\n * username,\n * confirmationCode,\n * });\n *\n * handleSignUpStep(nextStep);\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // signUpUtils.ts\n * async function handleSignUpStep( step: SignUpOutput[\"nextStep\"]) {\n * switch (step.signUpStep) {\n * case \"CONFIRM_SIGN_UP\":\n *\n * // Redirect end-user to confirm-sign up screen.\n *\n * case \"COMPLETE_AUTO_SIGN_IN\":\n *\t const codeDeliveryDetails = step.codeDeliveryDetails;\n * if (codeDeliveryDetails) {\n * // Redirect user to confirm-sign-up with link screen.\n * }\n * const signInOutput = await autoSignIn();\n * // handle sign-in steps\n * }\n *\n * ```\n */\n// TODO(Eslint): can this be refactored not using `let` on exported member?\n// eslint-disable-next-line import/no-mutable-exports\nexports.autoSignIn = initialAutoSignIn;\n/**\n * Sets the context of autoSignIn at run time.\n * @internal\n */\nfunction setAutoSignIn(callback) {\n exports.autoSignIn = callback;\n}\nexports.setAutoSignIn = setAutoSignIn;\n/**\n * Resets the context\n *\n * @internal\n */\nfunction resetAutoSignIn(resetCallback = true) {\n if (resetCallback) {\n exports.autoSignIn = initialAutoSignIn;\n }\n store_1.autoSignInStore.dispatch({ type: 'RESET' });\n}\nexports.resetAutoSignIn = resetAutoSignIn;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,eAAe,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,UAAU,GAAG,MAAM;AAC7E,MAAM,OAAO,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,iBAAiB,GAAG,YAAY;AACtC,IAAI,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACpC,QAAQ,IAAI,EAAE,WAAW,CAAC,sBAAsB;AAChD,QAAQ,OAAO,EAAE,uEAAuE;AACxF,QAAQ,kBAAkB,EAAE,oFAAoF;AAChH,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,UAAU,GAAG,iBAAiB;AACtC;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,IAAI,OAAO,CAAC,UAAU,GAAG,QAAQ;AACjC;AACA,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,aAAa,GAAG,IAAI,EAAE;AAC/C,IAAI,IAAI,aAAa,EAAE;AACvB,QAAQ,OAAO,CAAC,UAAU,GAAG,iBAAiB;AAC9C;AACA,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACvD;AACA,OAAO,CAAC,eAAe,GAAG,eAAe;;"}
1
+ {"version":3,"file":"autoSignIn.js","sources":["../../../../../src/providers/cognito/apis/autoSignIn.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.autoSignIn = void 0;\nexports.setAutoSignIn = setAutoSignIn;\nexports.resetAutoSignIn = resetAutoSignIn;\nconst store_1 = require(\"../../../client/utils/store\");\nconst AuthError_1 = require(\"../../../errors/AuthError\");\nconst constants_1 = require(\"../../../errors/constants\");\nconst initialAutoSignIn = async () => {\n throw new AuthError_1.AuthError({\n name: constants_1.AUTO_SIGN_IN_EXCEPTION,\n message: 'The autoSignIn flow has not started, or has been cancelled/completed.',\n recoverySuggestion: 'Please try to use the signIn API or log out before starting a new autoSignIn flow.',\n });\n};\n/**\n * Signs a user in automatically after finishing the sign-up process.\n *\n * This API will automatically sign a user in if the autoSignIn flow has been completed in the following cases:\n * - User confirmed their account with a verification code sent to their phone or email (default option).\n * - User confirmed their account with a verification link sent to their phone or email. In order to\n * enable this option you need to go to the Amazon Cognito [console](https://aws.amazon.com/pm/cognito),\n * look for your userpool, then go to the `Messaging` tab and enable `link` mode inside the `Verification message` option.\n * Finally you need to define the `signUpVerificationMethod` in your `Auth` config.\n *\n * @example\n * ```typescript\n * Amplify.configure({\n * Auth: {\n * Cognito: {\n * ...cognitoConfig,\n * signUpVerificationMethod: \"link\" // the default value is \"code\"\n * }\n *\t}});\n * ```\n *\n * @throws AutoSignInException - Thrown when the autoSignIn flow has not started, or has been cancelled/completed.\n * @returns The signInOutput.\n *\n * @example\n * ```typescript\n * // handleSignUp.ts\n * async function handleSignUp(\n * username:string,\n * password:string\n * ){\n * try {\n * const { nextStep } = await signUp({\n * username,\n * password,\n * options: {\n * userAttributes:{ email:'email@email.com'},\n * autoSignIn: true // This enables the auto sign-in flow.\n * },\n * });\n *\n * handleSignUpStep(nextStep);\n *\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // handleConfirmSignUp.ts\n * async function handleConfirmSignUp(username:string, confirmationCode:string) {\n * try {\n * const { nextStep } = await confirmSignUp({\n * username,\n * confirmationCode,\n * });\n *\n * handleSignUpStep(nextStep);\n * } catch (error) {\n * console.log(error);\n * }\n * }\n *\n * // signUpUtils.ts\n * async function handleSignUpStep( step: SignUpOutput[\"nextStep\"]) {\n * switch (step.signUpStep) {\n * case \"CONFIRM_SIGN_UP\":\n *\n * // Redirect end-user to confirm-sign up screen.\n *\n * case \"COMPLETE_AUTO_SIGN_IN\":\n *\t const codeDeliveryDetails = step.codeDeliveryDetails;\n * if (codeDeliveryDetails) {\n * // Redirect user to confirm-sign-up with link screen.\n * }\n * const signInOutput = await autoSignIn();\n * // handle sign-in steps\n * }\n *\n * ```\n */\n// TODO(Eslint): can this be refactored not using `let` on exported member?\n// eslint-disable-next-line import/no-mutable-exports\nexports.autoSignIn = initialAutoSignIn;\n/**\n * Sets the context of autoSignIn at run time.\n * @internal\n */\nfunction setAutoSignIn(callback) {\n exports.autoSignIn = callback;\n}\n/**\n * Resets the context\n *\n * @internal\n */\nfunction resetAutoSignIn(resetCallback = true) {\n if (resetCallback) {\n exports.autoSignIn = initialAutoSignIn;\n }\n store_1.autoSignInStore.dispatch({ type: 'RESET' });\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,UAAU,GAAG,MAAM;AAC3B,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC,OAAO,CAAC,eAAe,GAAG,eAAe;AACzC,MAAM,OAAO,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,iBAAiB,GAAG,YAAY;AACtC,IAAI,MAAM,IAAI,WAAW,CAAC,SAAS,CAAC;AACpC,QAAQ,IAAI,EAAE,WAAW,CAAC,sBAAsB;AAChD,QAAQ,OAAO,EAAE,uEAAuE;AACxF,QAAQ,kBAAkB,EAAE,oFAAoF;AAChH,KAAK,CAAC;AACN,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,CAAC,UAAU,GAAG,iBAAiB;AACtC;AACA;AACA;AACA;AACA,SAAS,aAAa,CAAC,QAAQ,EAAE;AACjC,IAAI,OAAO,CAAC,UAAU,GAAG,QAAQ;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,eAAe,CAAC,aAAa,GAAG,IAAI,EAAE;AAC/C,IAAI,IAAI,aAAa,EAAE;AACvB,QAAQ,OAAO,CAAC,UAAU,GAAG,iBAAiB;AAC9C;AACA,IAAI,OAAO,CAAC,eAAe,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACvD;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.confirmResetPassword = void 0;
6
+ exports.confirmResetPassword = confirmResetPassword;
7
7
  const core_1 = require("@aws-amplify/core");
8
8
  const utils_1 = require("@aws-amplify/core/internals/utils");
9
9
  const validation_1 = require("../../../errors/types/validation");
@@ -55,5 +55,4 @@ async function confirmResetPassword(input) {
55
55
  UserContextData,
56
56
  });
57
57
  }
58
- exports.confirmResetPassword = confirmResetPassword;
59
58
  //# sourceMappingURL=confirmResetPassword.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmResetPassword.js","sources":["../../../../../src/providers/cognito/apis/confirmResetPassword.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.confirmResetPassword = void 0;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst utils_2 = require(\"../../../utils\");\nconst userContextData_1 = require(\"../utils/userContextData\");\nconst cognitoIdentityProvider_1 = require(\"../../../foundation/factories/serviceClients/cognitoIdentityProvider\");\nconst factories_1 = require(\"../factories\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\n/**\n * Confirms the new password and verification code to reset the password.\n *\n * @param input - The ConfirmResetPasswordInput object.\n * @throws -{@link ConfirmForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code, password or username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmResetPassword(input) {\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n const { username, newPassword } = input;\n (0, assertValidationError_1.assertValidationError)(!!username, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordUsername);\n (0, assertValidationError_1.assertValidationError)(!!newPassword, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword);\n const code = input.confirmationCode;\n (0, assertValidationError_1.assertValidationError)(!!code, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode);\n const metadata = input.options?.clientMetadata;\n const UserContextData = (0, userContextData_1.getUserContextData)({\n username,\n userPoolId,\n userPoolClientId,\n });\n const confirmForgotPassword = (0, cognitoIdentityProvider_1.createConfirmForgotPasswordClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await confirmForgotPassword({\n region: (0, parsers_1.getRegionFromUserPoolId)(authConfig.userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.ConfirmResetPassword),\n }, {\n Username: username,\n ConfirmationCode: code,\n Password: newPassword,\n ClientMetadata: metadata,\n ClientId: authConfig.userPoolClientId,\n UserContextData,\n });\n}\nexports.confirmResetPassword = confirmResetPassword;\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,MAAM;AACrC,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAC7D,MAAM,yBAAyB,GAAG,OAAO,CAAC,sEAAsE,CAAC;AACjH,MAAM,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;AAC3C,MAAM,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,oBAAoB,CAAC,KAAK,EAAE;AAC3C,IAAI,MAAM,UAAU,GA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,CAAC,UAAU,CAAC,oBAAoB,CAAC;AACnG,KAAK,EAAE;AACP,QAAQ,QAAQ,EAAE,QAAQ;AAC1B,QAAQ,gBAAgB,EAAE,IAAI;AAC9B,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,cAAc,EAAE,QAAQ;AAChC,QAAQ,QAAQ,EAAE,UAAU,CAAC,gBAAgB;AAC7C,QAAQ,eAAe;AACvB,KAAK,CAAC;AACN;AACA,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;;"}
1
+ {"version":3,"file":"confirmResetPassword.js","sources":["../../../../../src/providers/cognito/apis/confirmResetPassword.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.confirmResetPassword = confirmResetPassword;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst validation_1 = require(\"../../../errors/types/validation\");\nconst assertValidationError_1 = require(\"../../../errors/utils/assertValidationError\");\nconst utils_2 = require(\"../../../utils\");\nconst userContextData_1 = require(\"../utils/userContextData\");\nconst cognitoIdentityProvider_1 = require(\"../../../foundation/factories/serviceClients/cognitoIdentityProvider\");\nconst factories_1 = require(\"../factories\");\nconst parsers_1 = require(\"../../../foundation/parsers\");\n/**\n * Confirms the new password and verification code to reset the password.\n *\n * @param input - The ConfirmResetPasswordInput object.\n * @throws -{@link ConfirmForgotPasswordException }\n * Thrown due to an invalid confirmation code or password.\n * @throws -{@link AuthValidationErrorCode }\n * Thrown due to an empty confirmation code, password or username.\n * @throws AuthTokenConfigException - Thrown when the token provider config is invalid.\n */\nasync function confirmResetPassword(input) {\n const authConfig = core_1.Amplify.getConfig().Auth?.Cognito;\n (0, utils_1.assertTokenProviderConfig)(authConfig);\n const { userPoolClientId, userPoolId, userPoolEndpoint } = authConfig;\n const { username, newPassword } = input;\n (0, assertValidationError_1.assertValidationError)(!!username, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordUsername);\n (0, assertValidationError_1.assertValidationError)(!!newPassword, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordNewPassword);\n const code = input.confirmationCode;\n (0, assertValidationError_1.assertValidationError)(!!code, validation_1.AuthValidationErrorCode.EmptyConfirmResetPasswordConfirmationCode);\n const metadata = input.options?.clientMetadata;\n const UserContextData = (0, userContextData_1.getUserContextData)({\n username,\n userPoolId,\n userPoolClientId,\n });\n const confirmForgotPassword = (0, cognitoIdentityProvider_1.createConfirmForgotPasswordClient)({\n endpointResolver: (0, factories_1.createCognitoUserPoolEndpointResolver)({\n endpointOverride: userPoolEndpoint,\n }),\n });\n await confirmForgotPassword({\n region: (0, parsers_1.getRegionFromUserPoolId)(authConfig.userPoolId),\n userAgentValue: (0, utils_2.getAuthUserAgentValue)(utils_1.AuthAction.ConfirmResetPassword),\n }, {\n Username: username,\n ConfirmationCode: code,\n Password: newPassword,\n ClientMetadata: metadata,\n ClientId: authConfig.userPoolClientId,\n UserContextData,\n });\n}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,oBAAoB,GAAG,oBAAoB;AACnD,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,OAAO,GAAG,OAAO,CAAC,gBAAgB,CAAC;AACzC,MAAM,iBAAiB,GAAG,OAAO,CAAC,0BAA0B,CAAC;AAC7D,MAAM,yBAAyB,GAAG,OAAO,CAAC,sEAAsE,CAAC;AACjH,MAAM,WAAW,GAAG,OAAO,CAAC,cAA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N,IAAI,MAAM,qBAAqB,CAAC;AAChC,QAAQ,MAAM,EAAE,IAAI,SAAS,CAAC,uBAAuB,EAAE,UAAU,CAAC,UAAU,CAAC;AAC7E,QAAQ,cAAc,EAAE,IAAI,OAAO,CAAC,qBAAqB,EAAE,OAAO,CAAC,UAAU,CAAC,oBAAoB,CAAC;AACnG,KAAK,EAAE;AACP,QAAQ,QAAQ,EAAE,QAAQ;AAC1B,QAAQ,gBAAgB,EAAE,IAAI;AAC9B,QAAQ,QAAQ,EAAE,WAAW;AAC7B,QAAQ,cAAc,EAAE,QAAQ;AAChC,QAAQ,QAAQ,EAAE,UAAU,CAAC,gBAAgB;AAC7C,QAAQ,eAAe;AACvB,KAAK,CAAC;AACN;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.confirmSignIn = void 0;
6
+ exports.confirmSignIn = confirmSignIn;
7
7
  const core_1 = require("@aws-amplify/core");
8
8
  const utils_1 = require("@aws-amplify/core/internals/utils");
9
9
  const store_1 = require("../../../client/utils/store");
@@ -95,5 +95,4 @@ async function confirmSignIn(input) {
95
95
  throw error;
96
96
  }
97
97
  }
98
- exports.confirmSignIn = confirmSignIn;
99
98
  //# sourceMappingURL=confirmSignIn.js.map
@@ -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 store_1 = require(\"../../../client/utils/store\");\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\");\nconst getNewDeviceMetadata_1 = require(\"../utils/getNewDeviceMetadata\");\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 } = store_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 and session has expired.\n\t\t\t`,\n recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n 'and that the session has not expired.',\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, store_1.setActiveSignInState)({\n signInSession: Session,\n username,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n await (0, cacheTokens_1.cacheCognitoTokens)({\n username,\n ...AuthenticationResult,\n NewDeviceMetadata: await (0, getNewDeviceMetadata_1.getNewDeviceMetadata)({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n (0, store_1.resetActiveSignInState)();\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;AAC7D,OAAO,CAAC,aAAa,GAAG,MAAM;AAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM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5E,YAAY,OAAO;AACnB,gBAAgB,UAAU,EAAE,IAAI;AAChC,gBAAgB,QAAQ,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;AAChD,aAAa;AACb;AACA,QAAQ,OAAO,CAAC,CAAC,EAAE,eAAe,CAAC,eAAe,EAAE;AACpD,YAAY,aAAa,EAAE,oBAAoB;AAC/C,YAAY,mBAAmB,EAAE,0BAA0B;AAC3D,SAAS,CAAC;AACV;AACA,IAAI,OAAO,KAAK,EAAE;AAClB,QAAQ,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,KAAK,CAAC;AAC3D,QAAQ,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,wBAAwB,EAAE,KAAK,CAAC,IAAI,CAAC;AAChF,QAAQ,IAAI,MAAM;AAClB,YAAY,OAAO,MAAM;AACzB,QAAQ,MAAM,KAAK;AACnB;AACA;AACA,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 = confirmSignIn;\nconst core_1 = require(\"@aws-amplify/core\");\nconst utils_1 = require(\"@aws-amplify/core/internals/utils\");\nconst store_1 = require(\"../../../client/utils/store\");\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\");\nconst getNewDeviceMetadata_1 = require(\"../utils/getNewDeviceMetadata\");\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 } = store_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 and session has expired.\n\t\t\t`,\n recoverySuggestion: 'Make sure a successful call to signIn is made before calling confirmSignIn' +\n 'and that the session has not expired.',\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, store_1.setActiveSignInState)({\n signInSession: Session,\n username,\n challengeName: handledChallengeName,\n signInDetails,\n });\n if (AuthenticationResult) {\n await (0, cacheTokens_1.cacheCognitoTokens)({\n username,\n ...AuthenticationResult,\n NewDeviceMetadata: await (0, getNewDeviceMetadata_1.getNewDeviceMetadata)({\n userPoolId: authConfig.userPoolId,\n userPoolEndpoint: authConfig.userPoolEndpoint,\n newDeviceMetadata: AuthenticationResult.NewDeviceMetadata,\n accessToken: AuthenticationResult.AccessToken,\n }),\n signInDetails,\n });\n (0, store_1.resetActiveSignInState)();\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}\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC7D,OAAO,CAAC,aAAa,GAAG,aAAa;AACrC,MAAM,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAC3C,MAAM,OAAO,GAAG,OAAO,CAAC,mCAAmC,CAAC;AAC5D,MAAM,OAAO,GAAG,OAAO,CAAC,6BAA6B,CAAC;AACtD,MAAM,WAAW,GAAG,OAAO,CAAC,2BAA2B,CAAC;AACxD,MAAM,eAAe,GAAG,OAAO,CAAC,wBAAwB,CAAC;AACzD,MAAM,oBAAoB,GAAG,OAAO,CAAC,0CAA0C,CAAC;AAChF,MAAM,uBAAuB,GAAG,OAAO,CAAC,6CAA6C,CAAC;AACtF,MAAM,YAAY,GAAG,OAAO,CAAC,kCAAkC,CAAC;AAChE,MAAM,kBAAkB,GAAG,OAAO,CAAC,kCAAkC,CAAC;AACtE,MAAM,aAAa,GAAG,OAAO,CAAC,8BAA8B,CAAC;AAC7D,MAAM,eAA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,IAAI,oBAAoB,CAAC,kBAAkB,EAAE,KAAK,CAAC;AAC3D,QAAQ,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,wBAAwB,EAAE,KAAK,CAAC,IAAI,CAAC;AAChF,QAAQ,IAAI,MAAM;AAClB,YAAY,OAAO,MAAM;AACzB,QAAQ,MAAM,KAAK;AACnB;AACA;;"}
@@ -3,7 +3,7 @@
3
3
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4
4
  // SPDX-License-Identifier: Apache-2.0
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.confirmSignUp = void 0;
6
+ exports.confirmSignUp = confirmSignUp;
7
7
  const core_1 = require("@aws-amplify/core");
8
8
  const utils_1 = require("@aws-amplify/core/internals/utils");
9
9
  const assertValidationError_1 = require("../../../errors/utils/assertValidationError");
@@ -93,5 +93,4 @@ async function confirmSignUp(input) {
93
93
  }
94
94
  });
95
95
  }
96
- exports.confirmSignUp = confirmSignUp;
97
96
  //# sourceMappingURL=confirmSignUp.js.map