开发者

Devise logs in, but doesn't seem to set session

开发者 https://www.devze.com 2023-02-24 22:32 出处:网络
I just upgraded to Devise 1.2 and开发者_高级运维 now I can login, but then when I go to another page and the before_filter calls authenticate_account! (because my model is \'account\', not \'user\') i

I just upgraded to Devise 1.2 and开发者_高级运维 now I can login, but then when I go to another page and the before_filter calls authenticate_account! (because my model is 'account', not 'user') it returns false, meaning I'm not logged it. It's as if the session cookie isn't getting created. What would cause this? I can't figure out how to track down what could be causing this. Thanks.


or add before_filter :authenticate_user! in application controller

class ApplicationController < ActionController::Base
  before_filter :authenticate_user!
  protect_from_forgery 
end


You have to create this for your before filter in your controllers:

before_filter :authenticate_user!
0

精彩评论

暂无评论...
验证码 换一张
取 消