Submit Reset Password Code on other page

authentication

#1

Hi ,
I am working on my app in which , after I submit the request for Forgot password , user will receive the email with an URL1 = (https://api.mydomain.com/dist/#/reset-password) and Reset Password Code.

I am planning to use my own reset password page with URL2 = www.myapp.com/reset, where the user will submit this Reset Password Code , New Password and Confirm Password and my app will submit this code to URL1 automatically.
Can anyone help me with this ? Do we have a curl command to follow the above mentioned steps ??


#2

Hi,
the first step will be to post the email to this API endpoint:

/user/password?reset=true

curl -X “POST” “https:/api.mydomain.com/api/v2/user/password?reset=true”
-H ‘Content-Type: application/json; charset=utf-8’
-d $’{
“email”: "your@email.com"
}’

In case the server answers with a statusCode 200 you will receive an email with a ‘Reset Password Code’. Make sure you have set up the email template in your Dreamfactory instance under Config->Email Templates.

In the second step you have to provide a webpage which receives the parameters (and extract them from the url) from the email (password code, email). This webpage should contain a form which pre-fills the reset code and email address along with an empty password field.

Then you submit the content of the form again to “https:/api.mydomain.com/api/v2/user/password”.

cCurl:

Request

curl -X “POST” “https://api.mydomain.com//api/v2/user/password
-H ‘Content-Type: application/json; charset=utf-8’
-d $’{
“email”: "your@email.com",
“code”: “578JRGJJ2X2IX3LG08WMAKITM5XMKXRP”,
“new_password”: “MyNewPassword”
}’

Hope this helps to get your app running!
Regards
Thomas