如何在铁轨中修复不匹配的CSRF真实性令牌?

发布于 2025-02-06 23:16:55 字数 432 浏览 1 评论 0原文

如果我正确理解了这一点,则输入真实性令牌应该与Head元素中的上述值匹配。

提交设计注册表格时,我会遇到422个无法实现的实体错误。

我确实删除了我的master.key和re-ran rails信誉:编辑以重生rails_master_keysecret_key_key_base

我相信这里的问题是因为这些值不匹配,因此没有处理该表格,导致设计用户没有创建。

enter image description here

If I am understanding this correctly the input authenticity token should be matching the value above in the head element.

When submitting the devise sign up form I get a 422 Unprocessible Entity error.

I did delete my master.key and re-ran rails credentitals:edit to regenerate the RAILS_MASTER_KEY and SECRET_KEY_BASE.

I believe the issue here is since these values are not matching, the form is not being processed resulting in the devise User not being created.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无力看清 2025-02-13 23:16:56

delete config/master.key和config/recortentials.yml.enc。然后运行Rails凭据:编辑,它将制作一个新密钥和加密的凭据文件。不要忘记重新启动导轨服务器。

Delete config/master.key and config/credentials.yml.enc. Then run rails credentials:edit and it will make a new key and encrypted credentials file. Don't forget to restart the rails server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文