简体   繁体   English

Appcelerator:自定义密码重置页-错误的请求,reset_password_token无效

[英]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 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}} . 我设置了一个URL结构为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. 这是重置密码电子邮件中的URL,当我单击电子邮件中的链接时,页面将加载并显示可见的表单字段。 On entering the new password the following is passed to GET request is passed to appcelerator. 输入新密码后,会将以下内容传递给GET请求,然后将其传递给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}} 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. 就我所知,一切看起来都很不错,使用下面的标准URL结构时,一切正常。

https://platform.appcelerator.com/#/users/reset_password/{{key}}/{{reset_password_token}} 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 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. 基本上,您需要在电子邮件模板中添加key = {{key}},然后将其与url一起从表单发送到appcelerator。 Also add ct=enterprise to the url parameters. 还要将ct = enterprise添加到url参数。

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. 显然,您不应该使用自己的应用程序密钥,而应使用模板中的{{key}}。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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