简体   繁体   English

ActionController :: InvalidAuthenticityToken:在表单上使用身份验证令牌进行验证

[英]ActionController::InvalidAuthenticityToken: verified with authentication token on the form

I don't know why it happens but my form for some reason does not post properly. 我不知道为什么会这样,但是由于某种原因我的表格无法正确发布。 I am very sure the form contains the required authentication token: 我非常确定表单包含必需的身份验证令牌:

<form action="/account/complete_verify_email/4df78710-e27b-4527-bd2d-71cd2e9a1271" method="post"
    <div style="margin:0;padding:0">
        <input name="authenticity_token" type="hidden" value="341b07dfa682ed11a045e19956e2e3f5f499e8cb">
    </div>
    <input id="password" name="password" type="password">
    <input name="commit" type="submit" value="Continue">
</form>

Note the authenticity_token is there. 请注意,这里有authenticity_token。 What happened? 发生了什么?

Update: And YOU KNOW WHAT? 更新:您知道什么? Quitting Safari and restart again solved the issue... but I can't think of what kind of intermittent behaviour could cause such problem. 退出Safari并再次重新启动可以解决此问题...但是我无法想到哪种间歇性行为可能会导致此类问题。

This is the output of your ruby code, yes? 这是您的ruby代码的输出,是吗? If you added the code that generated this form it would perhaps be easier to figure what goes wrong. 如果添加了生成此表单的代码,则可能更容易找出问题所在。

InvalidAuthenticityToken could (or should?) mean that the token is present but not correct, if restarting Safari helps it could be some timeout issues. InvalidAuthenticityToken可能(或应该?)表示该令牌存在但不正确,如果重新启动Safari帮助,则可能是超时问题。 Perhaps the session cookie expires too soon? 会话cookie可能过期太早了吗?

暂无
暂无

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

相关问题 删除表单Rails 4上的ActionController :: InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken on delete form Rails 4 ActionController::InvalidAuthenticityToken - ActionController::InvalidAuthenticityToken ActionController :: InvalidAuthenticityToken(ActionController :: InvalidAuthenticityToken):Rails 5 - ActionController::InvalidAuthenticityToken (ActionController::InvalidAuthenticityToken): Rails 5 使用 form_with 时出现“ActionController::InvalidAuthenticityToken”错误 - “ActionController::InvalidAuthenticityToken” error when using form_with 如何使用 Webpack 在 Rails 6 中提交 ajax 表格? 获取 ActionController::InvalidAuthenticityToken 错误 - How to submit ajax form in Rails 6 with Webpack? Getting ActionController::InvalidAuthenticityToken error 为什么我的表单的每个帖子都会收到 ActionController::InvalidAuthenticityToken? - Why am I getting ActionController::InvalidAuthenticityToken with every post of my form? 跨越部分和ActionController :: InvalidAuthenticityToken的Rails form_tag - Rails form_tag spanning partial and ActionController::InvalidAuthenticityToken Rails错误:ActionController :: InvalidAuthenticityToken - Rails Error: ActionController::InvalidAuthenticityToken Rails:ActionController :: InvalidAuthenticityToken - Rails: ActionController::InvalidAuthenticityToken ActionController :: InvalidAuthenticityToken和域名 - ActionController::InvalidAuthenticityToken and domain names
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM