以下使用rails生成devise:install
使用rails generate devise用户创建了一个新模型
rake db:migrate以创建用户表
添加devise_for:用户做
获取’users / sign_out’,:to => “色器件/会话#摧毁”
用我的浏览器退出结束
运行rails服务器
转到localhost:3000 / users / sign_up以创建新用户
转到localhost:3000 / users / sign_out将他注销
转到localhost:3000 / users / sign_in并尝试再次登录并失败并返回以下内容并将我发送回登录屏幕而不登录
Started POST "/users/sign_in" for 127.0.0.1 at 2012-07-13 16:55:28 +0800 Processing by Devise::SessionsController#create as HTML Parameters: {"utf8"=>"✓","authenticity_token"=>"cbFEP0FJ/e2XYHfub3ZeI7nEX0nCheXzCDs2ner3Zw8=","newuser"=>{"email"=>"henghong.lee@gmail.com","password"=>"[FILTERED]","remember_me"=>"0"},"commit"=>"Sign in"}Completed 401 Unauthorized in 1ms Processing by Devise::SessionsController#new as HTML Parameters: {"utf8"=>"✓","commit"=>"Sign in"}Rendered /Users/Kinnovate/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.1.2/app/vIEws/devise/shared/_links.erb (1.0ms)Rendered /Users/Kinnovate/.rvm/gems/ruby-1.9.3-p194/gems/devise-2.1.2/app/vIEws/devise/sessions/new.HTML.erb within layouts/application (4.9ms)Completed 200 OK in 175ms (VIEws: 16.5ms | ActiveRecord: 1.3ms)
我如何修复已完成401未经授权?
解决方法attr_accessor :password
似乎是问题的原因,因为该设计似乎没有为模型创建加密密码
总结以上是内存溢出为你收集整理的ruby-on-rails – Warden身份验证召回401 Unauthorized全部内容,希望文章能够帮你解决ruby-on-rails – Warden身份验证召回401 Unauthorized所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)