简体   繁体   中英

Appcelerator: Custom Password Reset Page - Bad Request, reset_password_token is invalid

I am trying to setup a custom account verification and password reset page on my own domain but I am getting errors when reset the password. If followed the instructions in the link below but it always fails.

http://docs.appcelerator.com/arrowdb/latest/#!/api/Users-method-request_reset_password

I have setup a page with the URL structure https://example.com/resetPassword/?reset_password_token={{reset_password_token}} .

This is the URL in the reset password email, when I clicking on the link in the email the page load with the form fields visible. On entering the new password the following is passed to GET request is passed to appcelerator.

https://api.cloud.appcelerator.com/v1/users/reset_password.json?key={{app_key}}&reset_password_token={{reset_password_token}}&password={{password}}&password_confirmation={{password_confirmation}}

The response text is:

"{ "meta": { "status":"fail", "code":400, "message":"Failed to reset password: reset_password_token is invalid", "method_name":"resetPassword" } } "

Everything looks fine to me as far I can see and when using the standard URL structure below it works fine.

https://platform.appcelerator.com/#/users/reset_password/{{key}}/{{reset_password_token}}

I found the answer here:

https://archive.appcelerator.com/topic/2838/custom-password-reset-page-bad-request-reset_password_token-is-invalid/3

Basically, you need to add key={{key}} in your email template, and send that along with the url to appcelerator from your form. Also add ct=enterprise to the url parameters.

Doing this i got it working. Had the same problem with invalid reset token. Appearantly you are not supposed to use your own app key, but the {{key}} in the template instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM