aws-amplify / amplify-js

A declarative JavaScript library for application development using cloud services.
https://docs.amplify.aws/lib/q/platform/js
Apache License 2.0
9.42k stars 2.12k forks source link

Unable To Reset User's Temporary Password: User needs to be authenticated to call this API #12906

Closed owhittlef closed 6 months ago

owhittlef commented 7 months ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication

Amplify Version

v6

Amplify Categories

auth

Backend

Other

Environment information

``` System: OS: Windows 10 10.0.17763 CPU: (4) x64 Intel(R) Xeon(R) Platinum 8488C Memory: 1.14 GB / 15.72 GB Binaries: Node: 18.17.0 - C:\Program Files\nodejs\node.EXE npm: 9.6.7 - C:\Program Files\nodejs\npm.CMD Browsers: Internet Explorer: 11.0.17763.2989 npmPackages: @headlessui/react: ^1.7.15 => 1.7.17 @hookform/resolvers: ^3.3.0 => 3.3.2 @hookform/resolvers/ajv: 1.0.0 @hookform/resolvers/arktype: 1.0.0 @hookform/resolvers/class-validator: 1.0.0 @hookform/resolvers/computed-types: 1.0.0 @hookform/resolvers/io-ts: 1.0.0 @hookform/resolvers/joi: 1.0.0 @hookform/resolvers/nope: 1.0.0 @hookform/resolvers/superstruct: 1.0.0 @hookform/resolvers/typanion: 1.0.0 @hookform/resolvers/typebox: 1.0.0 @hookform/resolvers/valibot: 1.0.0 @hookform/resolvers/vest: 1.0.0 @hookform/resolvers/yup: 1.0.0 @hookform/resolvers/zod: 1.0.0 @types/react: ^18.2.14 => 18.2.45 @types/react-dom: ^18.2.6 => 18.2.18 @vitejs/plugin-react: ^4.0.1 => 4.2.1 autoprefixer: ^10.4.14 => 10.4.16 aws-amplify: ^6.0.13 => 6.0.13 aws-amplify/adapter-core: undefined () aws-amplify/analytics: undefined () aws-amplify/analytics/kinesis: undefined () aws-amplify/analytics/kinesis-firehose: undefined () aws-amplify/analytics/personalize: undefined () aws-amplify/analytics/pinpoint: undefined () aws-amplify/api: undefined () aws-amplify/api/server: undefined () aws-amplify/auth: undefined () aws-amplify/auth/cognito: undefined () aws-amplify/auth/cognito/server: undefined () aws-amplify/auth/enable-oauth-listener: undefined () aws-amplify/auth/server: undefined () aws-amplify/datastore: undefined () aws-amplify/in-app-messaging: undefined () aws-amplify/in-app-messaging/pinpoint: undefined () aws-amplify/push-notifications: undefined () aws-amplify/push-notifications/pinpoint: undefined () aws-amplify/storage: undefined () aws-amplify/storage/s3: undefined () aws-amplify/storage/s3/server: undefined () aws-amplify/storage/server: undefined () aws-amplify/utils: undefined () classnames: ^2.3.2 => 2.3.2 country-flag-icons: ^1.5.9 => 1.5.9 country-flag-icons/commonjs: undefined () country-flag-icons/react/1x1: undefined () country-flag-icons/react/1x1/AC: undefined () country-flag-icons/react/1x1/AD: undefined () country-flag-icons/react/1x1/AE: undefined () country-flag-icons/react/1x1/AF: undefined () country-flag-icons/react/1x1/AG: undefined () country-flag-icons/react/1x1/AI: undefined () country-flag-icons/react/1x1/AL: undefined () country-flag-icons/react/1x1/AM: undefined () country-flag-icons/react/1x1/AO: undefined () country-flag-icons/react/1x1/AQ: undefined () country-flag-icons/react/1x1/AR: undefined () country-flag-icons/react/1x1/AS: undefined () country-flag-icons/react/1x1/AT: undefined () country-flag-icons/react/1x1/AU: undefined () country-flag-icons/react/1x1/AW: undefined () country-flag-icons/react/1x1/AX: undefined () country-flag-icons/react/1x1/AZ: undefined () country-flag-icons/react/1x1/BA: undefined () country-flag-icons/react/1x1/BB: undefined () country-flag-icons/react/1x1/BD: undefined () country-flag-icons/react/1x1/BE: undefined () country-flag-icons/react/1x1/BF: undefined () country-flag-icons/react/1x1/BG: undefined () country-flag-icons/react/1x1/BH: undefined () country-flag-icons/react/1x1/BI: undefined () country-flag-icons/react/1x1/BJ: undefined () country-flag-icons/react/1x1/BL: undefined () country-flag-icons/react/1x1/BM: undefined () country-flag-icons/react/1x1/BN: undefined () country-flag-icons/react/1x1/BO: undefined () country-flag-icons/react/1x1/BQ: undefined () country-flag-icons/react/1x1/BR: undefined () country-flag-icons/react/1x1/BS: undefined () country-flag-icons/react/1x1/BT: undefined () country-flag-icons/react/1x1/BV: undefined () country-flag-icons/react/1x1/BW: undefined () country-flag-icons/react/1x1/BY: undefined () country-flag-icons/react/1x1/BZ: undefined () country-flag-icons/react/1x1/CA: undefined () country-flag-icons/react/1x1/CC: undefined () country-flag-icons/react/1x1/CD: undefined () country-flag-icons/react/1x1/CF: undefined () country-flag-icons/react/1x1/CG: undefined () country-flag-icons/react/1x1/CH: undefined () country-flag-icons/react/1x1/CI: undefined () country-flag-icons/react/1x1/CK: undefined () country-flag-icons/react/1x1/CL: undefined () country-flag-icons/react/1x1/CM: undefined () country-flag-icons/react/1x1/CN: undefined () country-flag-icons/react/1x1/CO: undefined () country-flag-icons/react/1x1/CR: undefined () country-flag-icons/react/1x1/CU: undefined () country-flag-icons/react/1x1/CV: undefined () country-flag-icons/react/1x1/CW: undefined () country-flag-icons/react/1x1/CX: undefined () country-flag-icons/react/1x1/CY: undefined () country-flag-icons/react/1x1/CZ: undefined () country-flag-icons/react/1x1/DE: undefined () country-flag-icons/react/1x1/DJ: undefined () country-flag-icons/react/1x1/DK: undefined () country-flag-icons/react/1x1/DM: undefined () country-flag-icons/react/1x1/DO: undefined () country-flag-icons/react/1x1/DZ: undefined () country-flag-icons/react/1x1/EC: undefined () country-flag-icons/react/1x1/EE: undefined () country-flag-icons/react/1x1/EG: undefined () country-flag-icons/react/1x1/EH: undefined () country-flag-icons/react/1x1/ER: undefined () country-flag-icons/react/1x1/ES: undefined () country-flag-icons/react/1x1/ET: undefined () country-flag-icons/react/1x1/EU: undefined () country-flag-icons/react/1x1/FI: undefined () country-flag-icons/react/1x1/FJ: undefined () country-flag-icons/react/1x1/FK: undefined () country-flag-icons/react/1x1/FM: undefined () country-flag-icons/react/1x1/FO: undefined () country-flag-icons/react/1x1/FR: undefined () country-flag-icons/react/1x1/GA: undefined () country-flag-icons/react/1x1/GB: undefined () country-flag-icons/react/1x1/GD: undefined () country-flag-icons/react/1x1/GE: undefined () country-flag-icons/react/1x1/GF: undefined () country-flag-icons/react/1x1/GG: undefined () country-flag-icons/react/1x1/GH: undefined () country-flag-icons/react/1x1/GI: undefined () country-flag-icons/react/1x1/GL: undefined () country-flag-icons/react/1x1/GM: undefined () country-flag-icons/react/1x1/GN: undefined () country-flag-icons/react/1x1/GP: undefined () country-flag-icons/react/1x1/GQ: undefined () country-flag-icons/react/1x1/GR: undefined () country-flag-icons/react/1x1/GS: undefined () country-flag-icons/react/1x1/GT: undefined () country-flag-icons/react/1x1/GU: undefined () country-flag-icons/react/1x1/GW: undefined () country-flag-icons/react/1x1/GY: undefined () country-flag-icons/react/1x1/HK: undefined () country-flag-icons/react/1x1/HM: undefined () country-flag-icons/react/1x1/HN: undefined () country-flag-icons/react/1x1/HR: undefined () country-flag-icons/react/1x1/HT: undefined () country-flag-icons/react/1x1/HU: undefined () country-flag-icons/react/1x1/IC: undefined () country-flag-icons/react/1x1/ID: undefined () country-flag-icons/react/1x1/IE: undefined () country-flag-icons/react/1x1/IL: undefined () country-flag-icons/react/1x1/IM: undefined () country-flag-icons/react/1x1/IN: undefined () country-flag-icons/react/1x1/IO: undefined () country-flag-icons/react/1x1/IQ: undefined () country-flag-icons/react/1x1/IR: undefined () country-flag-icons/react/1x1/IS: undefined () country-flag-icons/react/1x1/IT: undefined () country-flag-icons/react/1x1/JE: undefined () country-flag-icons/react/1x1/JM: undefined () country-flag-icons/react/1x1/JO: undefined () country-flag-icons/react/1x1/JP: undefined () country-flag-icons/react/1x1/KE: undefined () country-flag-icons/react/1x1/KG: undefined () country-flag-icons/react/1x1/KH: undefined () country-flag-icons/react/1x1/KI: undefined () country-flag-icons/react/1x1/KM: undefined () country-flag-icons/react/1x1/KN: undefined () country-flag-icons/react/1x1/KP: undefined () country-flag-icons/react/1x1/KR: undefined () country-flag-icons/react/1x1/KW: undefined () country-flag-icons/react/1x1/KY: undefined () country-flag-icons/react/1x1/KZ: undefined () country-flag-icons/react/1x1/LA: undefined () country-flag-icons/react/1x1/LB: undefined () country-flag-icons/react/1x1/LC: undefined () country-flag-icons/react/1x1/LI: undefined () country-flag-icons/react/1x1/LK: undefined () country-flag-icons/react/1x1/LR: undefined () country-flag-icons/react/1x1/LS: undefined () country-flag-icons/react/1x1/LT: undefined () country-flag-icons/react/1x1/LU: undefined () country-flag-icons/react/1x1/LV: undefined () country-flag-icons/react/1x1/LY: undefined () country-flag-icons/react/1x1/MA: undefined () country-flag-icons/react/1x1/MC: undefined () country-flag-icons/react/1x1/MD: undefined () country-flag-icons/react/1x1/ME: undefined () country-flag-icons/react/1x1/MF: undefined () country-flag-icons/react/1x1/MG: undefined () country-flag-icons/react/1x1/MH: undefined () country-flag-icons/react/1x1/MK: undefined () country-flag-icons/react/1x1/ML: undefined () country-flag-icons/react/1x1/MM: undefined () country-flag-icons/react/1x1/MN: undefined () country-flag-icons/react/1x1/MO: undefined () country-flag-icons/react/1x1/MP: undefined () country-flag-icons/react/1x1/MQ: undefined () country-flag-icons/react/1x1/MR: undefined () country-flag-icons/react/1x1/MS: undefined () country-flag-icons/react/1x1/MT: undefined () country-flag-icons/react/1x1/MU: undefined () country-flag-icons/react/1x1/MV: undefined () country-flag-icons/react/1x1/MW: undefined () country-flag-icons/react/1x1/MX: undefined () country-flag-icons/react/1x1/MY: undefined () country-flag-icons/react/1x1/MZ: undefined () country-flag-icons/react/1x1/NA: undefined () country-flag-icons/react/1x1/NC: undefined () country-flag-icons/react/1x1/NE: undefined () country-flag-icons/react/1x1/NF: undefined () country-flag-icons/react/1x1/NG: undefined () country-flag-icons/react/1x1/NI: undefined () country-flag-icons/react/1x1/NL: undefined () country-flag-icons/react/1x1/NO: undefined () country-flag-icons/react/1x1/NP: undefined () country-flag-icons/react/1x1/NR: undefined () country-flag-icons/react/1x1/NU: undefined () country-flag-icons/react/1x1/NZ: undefined () country-flag-icons/react/1x1/OM: undefined () country-flag-icons/react/1x1/PA: undefined () country-flag-icons/react/1x1/PE: undefined () country-flag-icons/react/1x1/PF: undefined () country-flag-icons/react/1x1/PG: undefined () country-flag-icons/react/1x1/PH: undefined () country-flag-icons/react/1x1/PK: undefined () country-flag-icons/react/1x1/PL: undefined () country-flag-icons/react/1x1/PM: undefined () country-flag-icons/react/1x1/PN: undefined () country-flag-icons/react/1x1/PR: undefined () country-flag-icons/react/1x1/PS: undefined () country-flag-icons/react/1x1/PT: undefined () country-flag-icons/react/1x1/PW: undefined () country-flag-icons/react/1x1/PY: undefined () country-flag-icons/react/1x1/QA: undefined () country-flag-icons/react/1x1/RE: undefined () country-flag-icons/react/1x1/RO: undefined () country-flag-icons/react/1x1/RS: undefined () country-flag-icons/react/1x1/RU: undefined () country-flag-icons/react/1x1/RW: undefined () country-flag-icons/react/1x1/SA: undefined () country-flag-icons/react/1x1/SB: undefined () country-flag-icons/react/1x1/SC: undefined () country-flag-icons/react/1x1/SD: undefined () country-flag-icons/react/1x1/SE: undefined () country-flag-icons/react/1x1/SG: undefined () country-flag-icons/react/1x1/SH: undefined () country-flag-icons/react/1x1/SI: undefined () country-flag-icons/react/1x1/SJ: undefined () country-flag-icons/react/1x1/SK: undefined () country-flag-icons/react/1x1/SL: undefined () country-flag-icons/react/1x1/SM: undefined () country-flag-icons/react/1x1/SN: undefined () country-flag-icons/react/1x1/SO: undefined () country-flag-icons/react/1x1/SR: undefined () country-flag-icons/react/1x1/SS: undefined () country-flag-icons/react/1x1/ST: undefined () country-flag-icons/react/1x1/SV: undefined () country-flag-icons/react/1x1/SX: undefined () country-flag-icons/react/1x1/SY: undefined () country-flag-icons/react/1x1/SZ: undefined () country-flag-icons/react/1x1/TA: undefined () country-flag-icons/react/1x1/TC: undefined () country-flag-icons/react/1x1/TD: undefined () country-flag-icons/react/1x1/TF: undefined () country-flag-icons/react/1x1/TG: undefined () country-flag-icons/react/1x1/TH: undefined () country-flag-icons/react/1x1/TJ: undefined () country-flag-icons/react/1x1/TK: undefined () country-flag-icons/react/1x1/TL: undefined () country-flag-icons/react/1x1/TM: undefined () country-flag-icons/react/1x1/TN: undefined () country-flag-icons/react/1x1/TO: undefined () country-flag-icons/react/1x1/TR: undefined () country-flag-icons/react/1x1/TT: undefined () country-flag-icons/react/1x1/TV: undefined () country-flag-icons/react/1x1/TW: undefined () country-flag-icons/react/1x1/TZ: undefined () country-flag-icons/react/1x1/UA: undefined () country-flag-icons/react/1x1/UG: undefined () country-flag-icons/react/1x1/UM: undefined () country-flag-icons/react/1x1/US: undefined () country-flag-icons/react/1x1/UY: undefined () country-flag-icons/react/1x1/UZ: undefined () country-flag-icons/react/1x1/VA: undefined () country-flag-icons/react/1x1/VC: undefined () country-flag-icons/react/1x1/VE: undefined () country-flag-icons/react/1x1/VG: undefined () country-flag-icons/react/1x1/VI: undefined () country-flag-icons/react/1x1/VN: undefined () country-flag-icons/react/1x1/VU: undefined () country-flag-icons/react/1x1/WF: undefined () country-flag-icons/react/1x1/WS: undefined () country-flag-icons/react/1x1/XK: undefined () country-flag-icons/react/1x1/YE: undefined () country-flag-icons/react/1x1/YT: undefined () country-flag-icons/react/1x1/ZA: undefined () country-flag-icons/react/1x1/ZM: undefined () country-flag-icons/react/1x1/ZW: undefined () country-flag-icons/react/3x2: undefined () country-flag-icons/react/3x2/AC: undefined () country-flag-icons/react/3x2/AD: undefined () country-flag-icons/react/3x2/AE: undefined () country-flag-icons/react/3x2/AF: undefined () country-flag-icons/react/3x2/AG: undefined () country-flag-icons/react/3x2/AI: undefined () country-flag-icons/react/3x2/AL: undefined () country-flag-icons/react/3x2/AM: undefined () country-flag-icons/react/3x2/AO: undefined () country-flag-icons/react/3x2/AQ: undefined () country-flag-icons/react/3x2/AR: undefined () country-flag-icons/react/3x2/AS: undefined () country-flag-icons/react/3x2/AT: undefined () country-flag-icons/react/3x2/AU: undefined () country-flag-icons/react/3x2/AW: undefined () country-flag-icons/react/3x2/AX: undefined () country-flag-icons/react/3x2/AZ: undefined () country-flag-icons/react/3x2/BA: undefined () country-flag-icons/react/3x2/BB: undefined () country-flag-icons/react/3x2/BD: undefined () country-flag-icons/react/3x2/BE: undefined () country-flag-icons/react/3x2/BF: undefined () country-flag-icons/react/3x2/BG: undefined () country-flag-icons/react/3x2/BH: undefined () country-flag-icons/react/3x2/BI: undefined () country-flag-icons/react/3x2/BJ: undefined () country-flag-icons/react/3x2/BL: undefined () country-flag-icons/react/3x2/BM: undefined () country-flag-icons/react/3x2/BN: undefined () country-flag-icons/react/3x2/BO: undefined () country-flag-icons/react/3x2/BQ: undefined () country-flag-icons/react/3x2/BR: undefined () country-flag-icons/react/3x2/BS: undefined () country-flag-icons/react/3x2/BT: undefined () country-flag-icons/react/3x2/BV: undefined () country-flag-icons/react/3x2/BW: undefined () country-flag-icons/react/3x2/BY: undefined () country-flag-icons/react/3x2/BZ: undefined () country-flag-icons/react/3x2/CA: undefined () country-flag-icons/react/3x2/CC: undefined () country-flag-icons/react/3x2/CD: undefined () country-flag-icons/react/3x2/CF: undefined () country-flag-icons/react/3x2/CG: undefined () country-flag-icons/react/3x2/CH: undefined () country-flag-icons/react/3x2/CI: undefined () country-flag-icons/react/3x2/CK: undefined () country-flag-icons/react/3x2/CL: undefined () country-flag-icons/react/3x2/CM: undefined () country-flag-icons/react/3x2/CN: undefined () country-flag-icons/react/3x2/CO: undefined () country-flag-icons/react/3x2/CR: undefined () country-flag-icons/react/3x2/CU: undefined () country-flag-icons/react/3x2/CV: undefined () country-flag-icons/react/3x2/CW: undefined () country-flag-icons/react/3x2/CX: undefined () country-flag-icons/react/3x2/CY: undefined () country-flag-icons/react/3x2/CZ: undefined () country-flag-icons/react/3x2/DE: undefined () country-flag-icons/react/3x2/DJ: undefined () country-flag-icons/react/3x2/DK: undefined () country-flag-icons/react/3x2/DM: undefined () country-flag-icons/react/3x2/DO: undefined () country-flag-icons/react/3x2/DZ: undefined () country-flag-icons/react/3x2/EC: undefined () country-flag-icons/react/3x2/EE: undefined () country-flag-icons/react/3x2/EG: undefined () country-flag-icons/react/3x2/EH: undefined () country-flag-icons/react/3x2/ER: undefined () country-flag-icons/react/3x2/ES: undefined () country-flag-icons/react/3x2/ET: undefined () country-flag-icons/react/3x2/EU: undefined () country-flag-icons/react/3x2/FI: undefined () country-flag-icons/react/3x2/FJ: undefined () country-flag-icons/react/3x2/FK: undefined () country-flag-icons/react/3x2/FM: undefined () country-flag-icons/react/3x2/FO: undefined () country-flag-icons/react/3x2/FR: undefined () country-flag-icons/react/3x2/GA: undefined () country-flag-icons/react/3x2/GB: undefined () country-flag-icons/react/3x2/GD: undefined () country-flag-icons/react/3x2/GE: undefined () country-flag-icons/react/3x2/GF: undefined () country-flag-icons/react/3x2/GG: undefined () country-flag-icons/react/3x2/GH: undefined () country-flag-icons/react/3x2/GI: undefined () country-flag-icons/react/3x2/GL: undefined () country-flag-icons/react/3x2/GM: undefined () country-flag-icons/react/3x2/GN: undefined () country-flag-icons/react/3x2/GP: undefined () country-flag-icons/react/3x2/GQ: undefined () country-flag-icons/react/3x2/GR: undefined () country-flag-icons/react/3x2/GS: undefined () country-flag-icons/react/3x2/GT: undefined () country-flag-icons/react/3x2/GU: undefined () country-flag-icons/react/3x2/GW: undefined () country-flag-icons/react/3x2/GY: undefined () country-flag-icons/react/3x2/HK: undefined () country-flag-icons/react/3x2/HM: undefined () country-flag-icons/react/3x2/HN: undefined () country-flag-icons/react/3x2/HR: undefined () country-flag-icons/react/3x2/HT: undefined () country-flag-icons/react/3x2/HU: undefined () country-flag-icons/react/3x2/IC: undefined () country-flag-icons/react/3x2/ID: undefined () country-flag-icons/react/3x2/IE: undefined () country-flag-icons/react/3x2/IL: undefined () country-flag-icons/react/3x2/IM: undefined () country-flag-icons/react/3x2/IN: undefined () country-flag-icons/react/3x2/IO: undefined () country-flag-icons/react/3x2/IQ: undefined () country-flag-icons/react/3x2/IR: undefined () country-flag-icons/react/3x2/IS: undefined () country-flag-icons/react/3x2/IT: undefined () country-flag-icons/react/3x2/JE: undefined () country-flag-icons/react/3x2/JM: undefined () country-flag-icons/react/3x2/JO: undefined () country-flag-icons/react/3x2/JP: undefined () country-flag-icons/react/3x2/KE: undefined () country-flag-icons/react/3x2/KG: undefined () country-flag-icons/react/3x2/KH: undefined () country-flag-icons/react/3x2/KI: undefined () country-flag-icons/react/3x2/KM: undefined () country-flag-icons/react/3x2/KN: undefined () country-flag-icons/react/3x2/KP: undefined () country-flag-icons/react/3x2/KR: undefined () country-flag-icons/react/3x2/KW: undefined () country-flag-icons/react/3x2/KY: undefined () country-flag-icons/react/3x2/KZ: undefined () country-flag-icons/react/3x2/LA: undefined () country-flag-icons/react/3x2/LB: undefined () country-flag-icons/react/3x2/LC: undefined () country-flag-icons/react/3x2/LI: undefined () country-flag-icons/react/3x2/LK: undefined () country-flag-icons/react/3x2/LR: undefined () country-flag-icons/react/3x2/LS: undefined () country-flag-icons/react/3x2/LT: undefined () country-flag-icons/react/3x2/LU: undefined () country-flag-icons/react/3x2/LV: undefined () country-flag-icons/react/3x2/LY: undefined () country-flag-icons/react/3x2/MA: undefined () country-flag-icons/react/3x2/MC: undefined () country-flag-icons/react/3x2/MD: undefined () country-flag-icons/react/3x2/ME: undefined () country-flag-icons/react/3x2/MF: undefined () country-flag-icons/react/3x2/MG: undefined () country-flag-icons/react/3x2/MH: undefined () country-flag-icons/react/3x2/MK: undefined () country-flag-icons/react/3x2/ML: undefined () country-flag-icons/react/3x2/MM: undefined () country-flag-icons/react/3x2/MN: undefined () country-flag-icons/react/3x2/MO: undefined () country-flag-icons/react/3x2/MP: undefined () country-flag-icons/react/3x2/MQ: undefined () country-flag-icons/react/3x2/MR: undefined () country-flag-icons/react/3x2/MS: undefined () country-flag-icons/react/3x2/MT: undefined () country-flag-icons/react/3x2/MU: undefined () country-flag-icons/react/3x2/MV: undefined () country-flag-icons/react/3x2/MW: undefined () country-flag-icons/react/3x2/MX: undefined () country-flag-icons/react/3x2/MY: undefined () country-flag-icons/react/3x2/MZ: undefined () country-flag-icons/react/3x2/NA: undefined () country-flag-icons/react/3x2/NC: undefined () country-flag-icons/react/3x2/NE: undefined () country-flag-icons/react/3x2/NF: undefined () country-flag-icons/react/3x2/NG: undefined () country-flag-icons/react/3x2/NI: undefined () country-flag-icons/react/3x2/NL: undefined () country-flag-icons/react/3x2/NO: undefined () country-flag-icons/react/3x2/NP: undefined () country-flag-icons/react/3x2/NR: undefined () country-flag-icons/react/3x2/NU: undefined () country-flag-icons/react/3x2/NZ: undefined () country-flag-icons/react/3x2/OM: undefined () country-flag-icons/react/3x2/PA: undefined () country-flag-icons/react/3x2/PE: undefined () country-flag-icons/react/3x2/PF: undefined () country-flag-icons/react/3x2/PG: undefined () country-flag-icons/react/3x2/PH: undefined () country-flag-icons/react/3x2/PK: undefined () country-flag-icons/react/3x2/PL: undefined () country-flag-icons/react/3x2/PM: undefined () country-flag-icons/react/3x2/PN: undefined () country-flag-icons/react/3x2/PR: undefined () country-flag-icons/react/3x2/PS: undefined () country-flag-icons/react/3x2/PT: undefined () country-flag-icons/react/3x2/PW: undefined () country-flag-icons/react/3x2/PY: undefined () country-flag-icons/react/3x2/QA: undefined () country-flag-icons/react/3x2/RE: undefined () country-flag-icons/react/3x2/RO: undefined () country-flag-icons/react/3x2/RS: undefined () country-flag-icons/react/3x2/RU: undefined () country-flag-icons/react/3x2/RW: undefined () country-flag-icons/react/3x2/SA: undefined () country-flag-icons/react/3x2/SB: undefined () country-flag-icons/react/3x2/SC: undefined () country-flag-icons/react/3x2/SD: undefined () country-flag-icons/react/3x2/SE: undefined () country-flag-icons/react/3x2/SG: undefined () country-flag-icons/react/3x2/SH: undefined () country-flag-icons/react/3x2/SI: undefined () country-flag-icons/react/3x2/SJ: undefined () country-flag-icons/react/3x2/SK: undefined () country-flag-icons/react/3x2/SL: undefined () country-flag-icons/react/3x2/SM: undefined () country-flag-icons/react/3x2/SN: undefined () country-flag-icons/react/3x2/SO: undefined () country-flag-icons/react/3x2/SR: undefined () country-flag-icons/react/3x2/SS: undefined () country-flag-icons/react/3x2/ST: undefined () country-flag-icons/react/3x2/SV: undefined () country-flag-icons/react/3x2/SX: undefined () country-flag-icons/react/3x2/SY: undefined () country-flag-icons/react/3x2/SZ: undefined () country-flag-icons/react/3x2/TA: undefined () country-flag-icons/react/3x2/TC: undefined () country-flag-icons/react/3x2/TD: undefined () country-flag-icons/react/3x2/TF: undefined () country-flag-icons/react/3x2/TG: undefined () country-flag-icons/react/3x2/TH: undefined () country-flag-icons/react/3x2/TJ: undefined () country-flag-icons/react/3x2/TK: undefined () country-flag-icons/react/3x2/TL: undefined () country-flag-icons/react/3x2/TM: undefined () country-flag-icons/react/3x2/TN: undefined () country-flag-icons/react/3x2/TO: undefined () country-flag-icons/react/3x2/TR: undefined () country-flag-icons/react/3x2/TT: undefined () country-flag-icons/react/3x2/TV: undefined () country-flag-icons/react/3x2/TW: undefined () country-flag-icons/react/3x2/TZ: undefined () country-flag-icons/react/3x2/UA: undefined () country-flag-icons/react/3x2/UG: undefined () country-flag-icons/react/3x2/UM: undefined () country-flag-icons/react/3x2/US: undefined () country-flag-icons/react/3x2/UY: undefined () country-flag-icons/react/3x2/UZ: undefined () country-flag-icons/react/3x2/VA: undefined () country-flag-icons/react/3x2/VC: undefined () country-flag-icons/react/3x2/VE: undefined () country-flag-icons/react/3x2/VG: undefined () country-flag-icons/react/3x2/VI: undefined () country-flag-icons/react/3x2/VN: undefined () country-flag-icons/react/3x2/VU: undefined () country-flag-icons/react/3x2/WF: undefined () country-flag-icons/react/3x2/WS: undefined () country-flag-icons/react/3x2/XK: undefined () country-flag-icons/react/3x2/YE: undefined () country-flag-icons/react/3x2/YT: undefined () country-flag-icons/react/3x2/ZA: undefined () country-flag-icons/react/3x2/ZM: undefined () country-flag-icons/react/3x2/ZW: undefined () country-flag-icons/string/1x1: undefined () country-flag-icons/string/3x2: undefined () country-flag-icons/unicode: undefined () eslint: ^8.45.0 => 8.56.0 eslint-config-airbnb: ^19.0.4 => 19.0.4 eslint-config-prettier: ^8.8.0 => 8.10.0 eslint-plugin-import: ^2.27.5 => 2.29.1 eslint-plugin-jsx-a11y: ^6.7.1 => 6.8.0 eslint-plugin-react: ^7.32.2 => 7.33.2 eslint-plugin-react-hooks: ^4.6.0 => 4.6.0 eslint-plugin-react-refresh: ^0.4.1 => 0.4.5 example: 0.0.0 framer-motion: ^10.13.1 => 10.16.16 i18next: ^23.2.11 => 23.7.11 postcss: ^8.4.26 => 8.4.32 prettier-plugin-tailwindcss: ^0.4.1 => 0.4.1 prop-types: ^15.8.1 => 15.8.1 qrcode.react: ^3.1.0 => 3.1.0 react: ^18.2.0 => 18.2.0 react-dom: ^18.2.0 => 18.2.0 react-hook-form: ^7.45.2 => 7.49.2 react-i18next: ^13.0.2 => 13.5.0 react-icons: ^4.10.1 => 4.12.0 react-otp-input: ^3.1.1 => 3.1.1 react-query: ^3.39.3 => 3.39.3 react-router-dom: ^6.14.2 => 6.21.0 react-tooltip: ^5.21.1 => 5.25.0 react-verification-input: ^3.3.1 => 3.3.1 tailwindcss: ^3.3.3 => 3.3.7 vite: ^4.4.0 => 4.5.1 xvpay-sal: 1.3.0 => 1.3.0 zod: ^3.22.2 => 3.22.4 zustand: ^4.3.9 => 4.4.7 npmGlobalPackages: @aws-amplify/cli: 12.8.2 corepack: 0.18.0 npm: 9.6.7 vsts-npm-auth: 0.42.1 ```

Describe the bug

I am using AdminCreateUser to create a user on a web server like so using :

using Amazon;
using Amazon.CognitoIdentityProvider.Model;
using Amazon.CognitoIdentityProvider;

public UserType CreateUser(string username, string firstName, string lastName, string countryCode, string locale, out string message, bool sendTempPassword= false)
        {
            message = string.Empty;
            try
            {
                AdminCreateUserRequest request = new AdminCreateUserRequest
                {
                    UserPoolId = _cognitoProtocol.PoolId,
                    Username = username,
                    UserAttributes = new List<AttributeType>
                    {
                        new AttributeType
                        {
                            Name = "email",
                            Value = username
                        },
                        new AttributeType
                        {
                            Name = "given_name",
                            Value = firstName
                        },
                        new AttributeType
                        {
                            Name = "family_name",
                            Value = lastName
                        },
                        new AttributeType
                        {
                            Name = "locale",
                            Value = locale
                        },
                        new AttributeType
                        {
                            // Xvoucher custom attribute for user's country ISO-2 code
                            Name = "custom:country",
                            Value = countryCode
                        }
                    }
                };

                if (!sendTempPassword) request.MessageAction = MessageActionType.SUPPRESS;

                return _cognitoClient.AdminCreateUser(request).User;
            }
            catch (Exception ex)
            {
                message = _logger.LogException(ex);
                return null;
            }
        }

Note the server call is not using Amplify, it's just an AWS SDK for C#. The server connects to my user pool using an app client with a secret. After the server call, I have a user who looks like this in the console: image

Now, I would like to allow the user to reset their password in a React app with a custom UI. I am not using the hosted UI or or Amplify UI components. The React app connects to the pool though a different app client that is public and does not have a secret. I ask the user for the temp password (sent to their email when they are created with the server call) and a new password, and try to reset their password like so:

import { confirmSignIn, signIn } from 'aws-amplify/auth';

const confirmPendingUser = async (username, tempPassword, newPassword) => {
  try {
    const signInRslt = await signIn({
      username,
      password: tempPassword,
    });
    console.log('signIn', signInRslt);

    if (signInRslt.nextStep?.signInStep === 'CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED') {
      const confirmSignInRslt = await confirmSignIn({
        challengeResponse: newPassword,
      });
      console.log('confirmSignIn', confirmSignInRslt);
    }
  } catch (err) {
    console.error(err);
  }
};

I am following the docs here but something isn't quite right. The call to signIn() seems to work and returns CONFIRM_SIGN_IN_WITH_NEW_PASSWORD_REQUIRED as the next step, but then confirmSignIn() fails with the following error: image

As you can probably guess, after this error I do not get auth cookies written to my browser's storage. Despite the apparent failure, the user is now confirmed in Cognito, however, their email is not verified. image

Subsequent calls to signIn() fail with a similar error: image

FWIW, here's the implementation of handleSignIn from the stack trace above:

import { signIn } from 'aws-amplify/auth';

const handleSignIn = async (username, password) => {
  try {
    const signInRslt = await signIn({
      username,
      password,
    });
    console.log('signIn', signInRslt);
  } catch (err) {
    console.error('Error signing in', err);
  }
};

Expected behavior

Reproduction steps

I get this error by following the steps in the description. I also noticed I could get a similar error if I took a user who was working and set MFA to inactive for them. Then, I get this error: image

The implementation of handleSignIn() from the stacktrace above is in the issue description. I'm a little bewildered about this because MFA is set to optional on my pool. image

Code Snippet

All code is in the issue description.

Log output

I get the same level of detail with log level set to debug... ``` Error signing in UserUnAuthenticatedException: User needs to be authenticated to call this API. at assertAuthTokens (http://localhost:5173/node_modules/.vite/deps/chunk-RXKVDFOM.js?v=4451a83e:76:11) at getCurrentUser (http://localhost:5173/node_modules/.vite/deps/chunk-RXKVDFOM.js?v=4451a83e:123:3) at async signInWithSRP (http://localhost:5173/node_modules/.vite/deps/chunk-RXKVDFOM.js?v=4451a83e:3041:15) at async handleSignIn (http://localhost:5173/src/helpers/authHelpers.js?t=1706225062146:40:24) ```

aws-exports.js

Not applicable.

Manual configuration

Here's how I'm configuring Amplify:

Amplify.configure({
  Auth: {
    Cognito: {
      userPoolClientId: VITE_USER_POOL_CLIENT_ID,
      userPoolId: VITE_USER_POOL_ID,
      authenticationFlowType: 'CUSTOM_AUTH',
    },
  },
});
cognitoUserPoolsTokenProvider.setKeyValueStorage(new CookieStorage({ domain: 'xvoucher.us' }));

Additional configuration

Command: aws cognito-idp describe-user-pool --user-pool-id us-east-1_UqGevkEHM

Output:

{
  "UserPool": {
    "Id": "us-east-1_*********",
    "Name": "JOW MFA Sandbox 4",
    "Policies": {
      "PasswordPolicy": {
        "MinimumLength": 8,
        "RequireUppercase": true,
        "RequireLowercase": true,
        "RequireNumbers": true,
        "RequireSymbols": true,
        "TemporaryPasswordValidityDays": 7
      }
    },
    "DeletionProtection": "ACTIVE",
    "LambdaConfig": {
      "PostConfirmation": "arn:aws:lambda:us-east-1:*********:function:CognitoTriggers-PostConfirmation"
    },
    "LastModifiedDate": "2024-01-25T22:11:27.510000+00:00",
    "CreationDate": "2024-01-02T21:10:02.090000+00:00",
    "SchemaAttributes": [
      {
        "Name": "sub",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": false,
        "Required": true,
        "StringAttributeConstraints": {
          "MinLength": "1",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "name",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "given_name",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": true,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "family_name",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": true,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "middle_name",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "nickname",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "preferred_username",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "profile",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "picture",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "website",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "email",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": true,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "email_verified",
        "AttributeDataType": "Boolean",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false
      },
      {
        "Name": "gender",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "birthdate",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "10",
          "MaxLength": "10"
        }
      },
      {
        "Name": "zoneinfo",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "locale",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": true,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "phone_number",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "phone_number_verified",
        "AttributeDataType": "Boolean",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false
      },
      {
        "Name": "address",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "0",
          "MaxLength": "2048"
        }
      },
      {
        "Name": "updated_at",
        "AttributeDataType": "Number",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "NumberAttributeConstraints": {
          "MinValue": "0"
        }
      },
      {
        "Name": "custom:country",
        "AttributeDataType": "String",
        "DeveloperOnlyAttribute": false,
        "Mutable": true,
        "Required": false,
        "StringAttributeConstraints": {
          "MinLength": "2",
          "MaxLength": "2"
        }
      }
    ],
    "AutoVerifiedAttributes": ["email"],
    "UsernameAttributes": ["email"],
    "VerificationMessageTemplate": {
      "DefaultEmailOption": "CONFIRM_WITH_CODE"
    },
    "UserAttributeUpdateSettings": {
      "AttributesRequireVerificationBeforeUpdate": ["email"]
    },
    "MfaConfiguration": "OPTIONAL",
    "DeviceConfiguration": {
      "ChallengeRequiredOnNewDevice": true,
      "DeviceOnlyRememberedOnUserPrompt": true
    },
    "EstimatedNumberOfUsers": 36,
    "EmailConfiguration": {
      "SourceArn": "arn:aws:ses:us-east-1:*********:identity/*******@xvoucher.com",
      "EmailSendingAccount": "DEVELOPER"
    },
    "SmsConfiguration": {
      "SnsCallerArn": "arn:aws:iam::*********:role/service-role/XvoucherAuth-SNSSendMessagesRole",
      "ExternalId": "***************",
      "SnsRegion": "us-east-1"
    },
    "UserPoolTags": {},
    "SmsConfigurationFailure": "SNSSandbox",
    "AdminCreateUserConfig": {
      "AllowAdminCreateUserOnly": false,
      "UnusedAccountValidityDays": 7
    },
    "UsernameConfiguration": {
      "CaseSensitive": false
    },
    "Arn": "arn:aws:cognito-idp:us-east-1:*********:userpool/us-east-1_*********",
    "AccountRecoverySetting": {
      "RecoveryMechanisms": [
        {
          "Priority": 1,
          "Name": "verified_email"
        }
      ]
    }
  }
}

Mobile Device

NA

Mobile Operating System

NA

Mobile Browser

NA

Mobile Browser Version

NA

Additional information and screenshots

No response

HuiSF commented 7 months ago

Hi @owhittlef Thanks for reporting this issue.

Reading your issue description, the issue is that when you specify the domain attribute of the CookieStorage, even after signing a user correctly, it says no user has been authenticated.

I noticed that from your screenshot, you are running your web app on localhost for testing, so the domain for your web app is localhost. After a user signs in, following your settings, it sets an authentication token into the cookie store with the domain attribute having the value xvoucher.us. The domain is mismatched in this case, so the browser won't store the cookie, and furthermore, the library won't work as there is no auth token available.

This is expected behavior as you generally cannot set a cookie with a domain attribute that doesn't match the domain of your web app. It's a security measure to prevent cross-site scripting (XXS) attacks. Cookies are bound to a specific domain for security reasons.

For your use case you should consider setting the domain value dynamically based on the running environment of your app. For example, if you are running your web app in dev mode locally, you should set the domain as localhost, and set the actual domain when your app is running in production mode in your hosting space.

nadetastic commented 7 months ago

HI @owhittlef following up here - did the comment from @HuiSF help to get you unblocked?

owhittlef commented 7 months ago

Yes -- silly mistake on my part! Thank you @HuiSF and @nadetastic for your help!

I do have one other question... After resetting the password and passing the temp password sent to the user's email, the email is still unverified. It seems like it should be verified since the user provided a password sent to their email.

I'm guessing I could write the email as verified in the user verified lambda trigger, but is it necessary to do so? Is there a simpler way to make Cognito mark the user as verified when I provide a temp password sent to their email account?

nadetastic commented 7 months ago

@owhittlef correct that is expected behavior - setting a permanent password doesn't automatically verify email. You can either write the email as verified when creating the user, or update the user email attribute as shown in the documentation here - Also note that if using the Amplify UI Authenticator component, it incorporates this flow for you automatically.

nadetastic commented 6 months ago

@owhittlef I'm going to mark this issue as resolved, but let me know if you have any more related questions.