My application has three devise models: user, employer and auditor. I can create all three and log in with both user and employer, but Devise won’t create a new session for auditor.
Started POST "/auditors/sign_in" for 127.0.0.1 at 2012-10-05 01:41:44 +0200
Processing by Devise::SessionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"vg1hGiEx3Ly1YRVX1XaWyEkz85lJU/5Ap/TcVo8+xWo=", "auditor"=>{"email"=>"auditor5@gmail.com", "password"=>"[FILTERED]", "remember_me"=>"0"}, "commit"=>"Sign in"}
Completed 401 Unauthorized in 0ms
I used the devise generator to create the model:
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
..which looks the same in the other models.
Routes seem to be fine:
devise_for :auditors
devise_for :employers
resources :employers, :only => [:show, :edit, :index, :update, :credit]
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
devise_for :users
devise_for :users, :controllers => { :registrations => "registrations" }
I have not changed anything in the views or the sessions controller in devise. Any ideas are welcome.
Yesterday, I tried clearing my browser cache and still no success. Posted question on SA. This morning, I simply started my computer, openend the browser and registration and sign_in worked. Not sure why.
Suggestion: Try restarting server, cleaning cookies, open/close browser.