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

While forgot password getting error username/client id combination not found. #10157

Closed satishSKY closed 1 year ago

satishSKY commented 2 years ago

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

Authentication

Amplify Categories

auth

Environment information

``` # Put output below this line System: OS: Linux 5.15 Ubuntu 20.04.4 LTS (Focal Fossa) CPU: (8) x64 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz Memory: 2.43 GB / 15.36 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm Browsers: Chrome: 103.0.5060.134 Firefox: 103.0 npmPackages: @ampproject/toolbox-optimizer: undefined () @aws-amplify/auth: 4.3.20 => 4.3.20 @babel/core: undefined () @babel/plugin-proposal-optional-chaining: ^7.13.0 => 7.18.6 @babel/preset-env: ^7.13.5 => 7.18.6 @cloudinary/url-gen: 1.6.0 => 1.6.0 @date-io/date-fns: 1.3.13 => 1.3.13 @hookform/resolvers: 2.8.5 => 2.8.5 @material-ui/core: 4.12.3 => 4.12.3 @material-ui/data-grid: 4.0.0-alpha.37 => 4.0.0-alpha.37 @material-ui/icons: 4.11.2 => 4.11.2 @material-ui/lab: 4.0.0-alpha.60 => 4.0.0-alpha.60 @material-ui/pickers: 3.3.10 => 3.3.10 @next/bundle-analyzer: ^11.0.1 => 11.1.4 @testing-library/jest-dom: ^5.11.9 => 5.16.4 @testing-library/react: ^11.2.5 => 11.2.7 amazon-quicksight-embedding-sdk: ^1.18.1 => 1.19.0 amphtml-validator: undefined () arg: undefined () async-retry: undefined () async-sema: undefined () aws-amplify: 4.3.12 => 4.3.12 aws-sdk: 2.1055.0 => 2.1055.0 babel-eslint: ^10.1.0 => 10.1.0 babel-jest: ^26.6.3 => 26.6.3 babel-plugin-dynamic-import-node: ^2.3.3 => 2.3.3 babel-plugin-module-resolver: ^4.1.0 => 4.1.0 bfj: undefined () cacache: undefined () cache-loader: undefined () ci-info: undefined () class-validator: 1.0.0 cloudinary-react: 1.7.1 => 1.7.1 clsx: 1.1.1 => 1.1.1 comment-json: undefined () compression: undefined () computed-types: 1.0.0 conf: undefined () content-type: undefined () cookie: undefined () cross-env: 7.0.3 => 7.0.3 css-loader: undefined () date-fns: 2.22.1 => 2.22.1 date-fns-tz: 1.2.2 => 1.2.2 debug: undefined () devalue: undefined () escape-string-regexp: undefined () eslint: ^7.20.0 => 7.32.0 eslint-config-prettier: ^8.0.0 => 8.5.0 eslint-import-resolver-babel-module: ^5.2.0 => 5.3.1 eslint-plugin-import: ^2.22.1 => 2.26.0 eslint-plugin-jsx-a11y: ^6.4.1 => 6.6.0 eslint-plugin-prettier: ^3.3.1 => 3.4.1 eslint-plugin-react: ^7.22.0 => 7.30.1 eslint-plugin-react-hooks: ^4.2.0 => 4.6.0 eslint-plugin-simple-import-sort: ^7.0.0 => 7.0.0 file-loader: undefined () find-cache-dir: undefined () find-up: undefined () fresh: undefined () gzip-size: undefined () http-proxy: undefined () husky: ^4.3.8 => 4.3.8 identity-obj-proxy: ^3.0.0 => 3.0.0 ignore-loader: undefined () io-ts: 1.0.0 is-animated: undefined () is-docker: undefined () is-wsl: undefined () jest: ^26.6.3 => 26.6.3 joi: 1.0.0 json5: undefined () jsonwebtoken: undefined () lint-staged: ^10.5.4 => 10.5.4 loader-utils: undefined () lodash.curry: undefined () lru-cache: undefined () nanoid: undefined () neo-async: undefined () next: 10.2.0 => 10.2.0 next-auth: 3.29.0 => 3.29.0 next-i18next: 8.10.0 => 8.10.0 next-i18next-create-client: undefined () nope: 1.0.0 npm-run-all: ^4.1.5 => 4.1.5 ora: undefined () postcss-flexbugs-fixes: undefined () postcss-loader: undefined () postcss-preset-env: undefined () postcss-scss: undefined () prettier: ^2.2.1 => 2.7.1 prop-types: 15.8.1 => 15.8.1 (15.7.2) react: 17.0.2 => 17.0.2 react-dom: 17.0.2 => 17.0.2 react-google-recaptcha: 2.1.0 => 2.1.0 react-hook-form: 7.9.0 => 7.9.0 react-infinite-scroll-component: 6.1.0 => 6.1.0 react-input-mask: 2.0.4 => 2.0.4 react-number-format: 4.9.1 => 4.9.1 react-redux: 7.2.6 => 7.2.6 react-slick: 0.28.1 => 0.28.1 react-test-renderer: ^17.0.1 => 17.0.2 react-to-print: ^2.14.1 => 2.14.7 recast: undefined () redux: 4.1.2 => 4.1.2 redux-devtools-extension: 2.13.9 => 2.13.9 redux-persist: 6.0.0 => 6.0.0 redux-persist/integration/react: undefined () redux-thunk: 2.4.1 => 2.4.1 reselect: 4.1.5 => 4.1.5 resize-observer-polyfill: ^1.5.1 => 1.5.1 resolve-url-loader: undefined () run: 1.4.0 => 1.4.0 sass: 1.47.0 => 1.47.0 sass-loader: undefined () schema-utils: undefined () semver: undefined () send: undefined () simplebar-react: 2.3.6 => 2.3.6 slick-carousel: 1.8.1 => 1.8.1 source-map: undefined () string-hash: undefined () strip-ansi: undefined () superstruct: 1.0.0 terser: undefined () text-table: undefined () thread-loader: undefined () typanion: 1.0.0 unfetch: 4.2.0 => 4.2.0 unfetch-polyfill: undefined () unistore: undefined () vest: 1.0.0 web-vitals: undefined () webpack: undefined () webpack-sources: undefined () yup: 0.32.11 => 0.32.11 (1.0.0) zod: 1.0.0 npmGlobalPackages: corepack: 0.10.0 npm: 8.1.2 ```

Describe the bug

When I try to forgot password and after entering a valid OTP and trying to submit the form, Cognito return the error username/client id combination not found

Expected behavior

It should update the new password

Reproduction steps

There are no particular scenarios here. We have registered through the signup method in cognito. Missed the password Try to rest password using forgot password

Code Snippet

// Put your code below this line.

const response = await Auth.forgotPasswordSubmit(username, code, new_password);

Log output

``` // Put your logs below this line ```

aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

nadetastic commented 2 years ago

Hi @satishSKY 👋,

I took a look at this issue, but haven't been able to replicate it on my end. I do have some questions for you however:

satishSKY commented 2 years ago

@nadetastic Here is the answer to your above questions.

Where I can find the aws-exports.js file. (Is it part of node-module) ?

nadetastic commented 2 years ago

@satishSKY Okay the issue you are facing may be part of the email not being verified. How are you receiving the code to use with Auth.forgotPasswordSubmit(username, code, new_password)? You should first call Auth.forgotPassword(username) which will trigger Cognito to send a verification code to the user.

Also aws-exports.js file can be located at the root of your project under the ./src folder

nadetastic commented 2 years ago

Hi @satishSKY, following up on this - let me know if you are still facing this issue.

nadetastic commented 1 year ago

Closing out this issue for now, if you still need assistance you can re-open at your convenience.