开发者

Devise + Omniauth + Rememberable

I followed the tutorial on the github devise wiki : https://github.com/plataformatec/devise/wiki/OmniAuth%3A-Overview

So I've created a omniauth controller for the callbacks, but it is bypassing the normal sessions controller and so, the rememberable cookie is not set.

What is the best way for me to fix that ?

Thanks for your help.

EDIT : The Gist from my controller code : https://gist.github.com/913164 So I think the sign in an redirect just set the session cookie, not the rememberable one.

EDIT 2 : I also have a backdoor for dev si开发者_如何转开发gn in and avoid FB connect on my local machine :

  def backdoor
        if RAILS_ENV == "development"
            @user = User.first
            @user.remember_me!
            sign_in_and_redirect @user, :event => :authentication
        end
  end

Doesn't work either, so I might have a problem somewhere else.


Damn this is old, sorry to let this stay here this long.

From my answer in the comments apparently in 11', I forgot to add this:

@user.remember_me = true

Now let's close this.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜