-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remember_me! not working with omniauth #776
Comments
Hrm yeah, I can see why this is not working. Not quite an easy fix. Sorry, but you will have to hold on a bit without this feature. :( |
Cross posted from the Devise Google Group per Jose Valim's request: I'm trying to invoke the rememberable hook on a user that I log in manually via the sign_in(user) method from the Devise helpers. However, when I do this, the rememberable hook doesn't seem to be called. Am I missing something? To compensate I dug into the Devise source to call the rememberable methods directly. This is brittle and thus I hope there's a better solution. Here's what I'm doing now and this works though it's not ideal. user = a_valid_persisted_user #pseudo code Note: devise :rememberable is in the User model |
Yes, exactly. It won't work until I fix it. The same fix for both cases! |
Hi, I'm experiencing the same issue. Is there any workaround for this bug? |
Just ran into this myself, struggling to find a workaround. |
Someone posted above that doing:
User.serialize_into_cookie(user) In your omniauth callback action should work. I have not tested personally. |
The above solution set the cookie as a session one, so it will expire as soon as you close your browser. You have to set the cookie expires to user.remember_expires_at. |
Fixed on Devise master. You just need to set user.remember_me = true and call sign_in. Devise will do all the rest for you. |
@josevalim @prettynatty Once we are remembering users this way using a cookie post-OAuth authentication, how would you suggest setting up routes to check for a local cookie first? Right now, my users click "Login with Venmo" and I don't check for this cookie, so the user is always forced to provide Venmo credentials in the standard OAuth login dialogue box: http://cl.ly/image/1n2a060k1m3a |
I integrated devise with omniauth accorting ti the wiki page. openid, oauth authorization types works fine but remember_me does not work.
Here is a part of my User::Omniauth::CallbacksController:
The text was updated successfully, but these errors were encountered: