サイト認証にDeviseを使用しています。ユーザーモデルを次のように設定しました。
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable,
:token_authenticatable, :confirmable
attr_accessible :email, :name, :password, :password_confirmation, :remember_me, :college_id, :role
次のルートで:
devise_for :users
as :user do
get 'sign_in' => 'devise/sessions#new', :as => :login
post 'sign_in' => 'devise/sessions#create', :as => :user_session
delete 'sign_out' => 'devise/sessions#destroy', :as => :logout
get 'signup' => 'devise/registrations#new', :as => :signup
get 'forgot_password' => 'devise/passwords#new', :as => :forgot_password
get 'resend_confirmation' => 'devise/confirmations#new', :as => :resend_confirmation
end
次のエラーが表示されます。
Started POST "/sign_in" for 127.0.0.1 at 2013-05-06 19:57:34 -0400
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"iy0BI3A6zY5TTIJ2eYkOpgwFIFubO2O8wII8GAmjDmE=", "email"=>"user@cmu.edu", "password"=>"[FILTERED]", "x"=>"-630", "y"=>"-434"}
Completed 401 Unauthorized in 1ms
Processing by Devise::SessionsController#new as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"iy0BI3A6zY5TTIJ2eYkOpgwFIFubO2O8wII8GAmjDmE=", "email"=>"user@cmu.edu", "password"=>"[FILTERED]", "x"=>"-630", "y"=>"-434"}
これは、「無効な電子メールまたはパスワード」として UI に表示されます。ただし、入力したパスワードが正しく、ユーザーがデータベースに存在することは確かです (コンソールで確認されています)。Devise はデータベースに対してクエリを行っていないようです。これは正常ですか?
何か案は?すべての助けに感謝します。