关于 ruby?? on rails:Devise Reset password token 不能为空
Devise Reset password token can't be blank
在尝试重置密码时,我正在尝试在我的 rails 应用程序中显示错误"重置密码令牌不能为空白"。我在控制台中收到一封电子邮件,其中包含重置密码的链接。当我打开链接并输入我的新密码时,我收到错误"重置密码令牌不能为空白"
为什么会出现此错误,我该如何解决?我也在使用 devise-basecamper gem
如果还有什么我可以发布的有用的信息,请告诉我。
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
Started GET"/users/password/new" for 127.0.0.1 at 2014-01-08 22:43:09 -0600
Processing by Devise::PasswordsController#new as HTML Account Load (0.3ms) SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`subdomain` = 'mysubdomain' LIMIT 1 Company Load (0.2ms) SELECT `companies`.* FROM `companies` WHERE `companies`.`account_id` = 1 LIMIT 1 (0.3ms) SELECT COUNT(*) FROM `applicants` WHERE `applicants`.`company_id` = 1 AND (viewed = false and archived = false and submitted = true) Rendered devise/passwords/new.html.erb within layouts/session (17.5ms) Completed 200 OK in 808ms (Views: 309.2ms | ActiveRecord: 44.8ms) Wed, 15 Jan 2014 19:04:50 CST -06:00 Wed, 08 Jan 2014 22:43:17 CST -06:00
Started POST"/users/password" for 127.0.0.1 at 2014-01-08 22:43:17 -0600 Sent mail to support@example.com (32ms) <p>Hello support@example.com!</p> <p>Someone has requested a link to change your password, and you can do this through the link below.</p> <p>Change my password</p> <p>If you didn't request this, please ignore this email.</p> Redirected to http://mysubdomain.127.0.0.1.xip.io:3000/login
Started GET"/login" for 127.0.0.1 at 2014-01-08 22:43:18 -0600
Started GET"/users/password/edit?reset_password_token=[FILTERED]" for 127.0.0.1 at 2014-01-08 22:43:28 -0600
Started PUT"/users/password" for 127.0.0.1 at 2014-01-08 22:43:39 -0600 |
相关讨论
- 请分享用户模型。
- 应用程序是全新的还是从 Rails 3 升级到 4?这可能是一个强大的参数问题或一些陈旧的设计配置。
- 哥们,你有没有得到这样的链接,localhost:3000/users/password/...,看到查询参数中的reset_password_token??同样在您设置的密码页面中,请确保您有这样的行.. <input name="user[reset_password_token]" type="hidden" value="GVN7DnKTVVsE15gMXaFb" />
- @beck03076 我看到设计视图缺少该隐藏字段。我查看了我的 git 存储库,发现该文件曾经包含该隐藏字段,但我一定已将其删除。您能否将您的解决方案发布为答案,我将进行测试以确保这确实是原因?
你有这样的链接吗?
http://localhost.com/users/password/edit?reset_password_token=GVN7DnKTVVsE15gMXaFb
(删除 .com)
看到查询参数中的reset_password_token 了吗?
同样在你的设置密码页面,确保你有这样的行
|
1
|
<input class="hidden" id="user_reset_password_token" name="user[reset_password_token]" type="hidden" value="GVN7DnKTVVsE15gMXaFb" />
|
相关讨论
- 是的,行应该像这样 <%= f.hidden_??field :reset_password_token %>