我最近对我的铁路机体进行了升级,从沉积的“美丽”中设计,而设计的标志页(用电子邮件浏览)。 我不想通过电子邮件进行认证,但当我对使用模式的标识进行认证时,它就不再发挥作用,我有以下错误:
Invalid email or password.
Devise.rb
config.authentication_keys = [ :login ]
用户b
class User < ActiveRecord::Base
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :validatable, :trackable,
:encryptable, :encryptor => :restful_authentication_sha1
attr_accessible :login, :email, :password, :password_confirmation, :remember_me, :twitter_name, :twitter_id, :atoken, :asecret
纽约总部
= form_tag session_path, :class => enter_form do
%label.form_label_small{:for => "login", :style => "color: #336699"} username
%br/
= text_field_tag login , @login, :class => input_style_state , :style => width: 250px;
.clear{:style => height: 4px }
%label.form_label_small{:for => "password", :style => "color: #336699"} password
%br/
= password_field_tag password , nil, :style => width: 250px;
.clear{:style => height: 4px }
%p{:style => "padding: 0; margin:0;"}
= check_box_tag remember_me , 1 , @remember_me, :style => padding: 0; margin: 0; border: 0
= label_tag remember_me , remember me
.clear{:style => "height: 8px"}
%a.button.submit_form{:href => /login }
%span{:style => width: 40px }
login
我与另一个项目存在同样的问题。 我想象:log是否成功地作为认证钥匙,错误信息将说错误的标识或密码无效,而后是无效的电子邮件或密码。
任何关于如何阻止这种失败的想法? 我的错误记录没有说什么。 此处为:
Started POST "/users/sign_in" for 127.0.0.1 at Thu Nov 10 13:46:13 -0500 2011
Processing by Devise::SessionsController#create as HTML
Parameters: {"authenticity_token"=>"AMole3YOhXPuOQGX27W1Mr7c18XR1Xk9DUF6JvstbZA=", "utf8"=>"✓", "user"=>{"remember_me"=>"0", "login"=>"aressidi", "password"=>"[FILTERED]"}}
User Load (0.4ms) SELECT `users`.* FROM `users` WHERE `users`.`login` = aressidi LIMIT 1
NavAd Load (0.3ms) SELECT `nav_ads`.* FROM `nav_ads`
Completed in 34ms
Processing by Devise::SessionsController#new as HTML
Parameters: {"authenticity_token"=>"AMole3YOhXPuOQGX27W1Mr7c18XR1Xk9DUF6JvstbZA=", "utf8"=>"✓", "user"=>{"remember_me"=>"0", "login"=>"aressidi", "password"=>"[FILTERED]"}}