AWS Amplify - Is there an API to validate the code sent using forgotPassword and change the password after the validation?
Asked Answered
R

0

6

I'm using cognito user pools for user management and using the flow of forgotPassword a confirmation code is sent to the user. For UI purposes I need to validate the code that is sent when I call the API ForgotPassword without sending the new password yet. I need like a middle step between ForgotPassword and ConfirmForgotPassword.

The function below is the one sending the code:

Auth.forgotPassword(username)

This function is resetting the password with the code sent (here I'm notified if the code is invalid)

Auth.forgotPasswordSubmit(username, code, new_password)

Is it possible to only validate the code sent with the existing API's available?

Here a link with information: https://docs.amplify.aws/lib/auth/manageusers/q/platform/js#forgot-password

Roundtheclock answered 10/2, 2021 at 23:40 Comment(2)
Did you ever work this out? I am currently searching for the same answer. Is there a way to get it to verify all fields and return all errors at once, and just send an empty string for the password?Owe
I couldn't find a way to do it. I ended up collecting in the UI the two parameters required code and the new password with a stepper component, then I called the API with all the required parameters.Roundtheclock

© 2022 - 2024 — McMap. All rights reserved.