问题描述
Safari实际上覆盖了应该表示密码重置标记的HIDDEN表单字段(标识为 user_reset_password_token
,名称为 user [reset_password_token]
您可以想象,当令牌不正确时重置密码不起作用,所以我已经
我已经证实,如果我在Safari中禁用自动填充功能,或者使用Safari以外的任何浏览器,它都可以正常工作。
有没有人有解决这个问题的办法?
解决方案刚刚有同样的问题。我解决了添加 readonly
属性到我的隐藏输入中的问题,如下所示:
= f.hidden_field:reset_password_token,只读:true
所以我得到了这个:
< input id =user_reset_password_tokenname =user [reset_password_token]readonly =readonlytype =hiddenvalue = YXHRuRgppyzxqsdEXiNm >
Safari is actually overwriting a HIDDEN form field that is supposed to represent a password reset token (ID is user_reset_password_token
and name is user[reset_password_token]
) with my email address.
As you can imagine, resetting the password doesn't work when the token is incorrect, so I've got an issue.
I've confirmed that it works just fine if I disable autofill in Safari, or use any browser other than Safari.
Does anyone have a solution to this issue?
解决方案 Just had the same issue. I solved the problem with adding readonly
attribute to my hidden input, like this:
= f.hidden_field :reset_password_token, readonly: true
so I've got this:
<input id="user_reset_password_token" name="user[reset_password_token]" readonly="readonly" type="hidden" value="YXHRuRgppyzxqsdEXiNm">
这篇关于Safari自动填充隐藏的“重置密码令牌”输入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!