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 confusion #3150
Comments
The first option is the correct one. The other two simply set the default value of the field to true, which means it will be automatically remembered whenever the first one is called. If it works in some browsers or not, it is likely a browser issue because the server is definitely sending the proper cookies. Try to confirm if the cookie is indeed correct and find out if the browser is storing it properly. |
Thanks! |
That solution is not working for me in any browser. Here's my controller code: class People::OmniauthCallbacksController < Devise::OmniauthCallbacksController
include Devise::Controllers::Rememberable
def github
@person = Person.from_omniauth(request.env["omniauth.auth"])
if @person.persisted?
remember_me(@person)
sign_in_and_redirect @person, :event => :authentication
set_flash_message(:notice, :success, :kind => "GitHub") if is_navigational_format?
else
session["devise.github_data"] = request.env["omniauth.auth"]
redirect_to new_person_registration_url
end
end
end I'm on Ruby 2.1.2, Rails 4.1.5, Devise 3.3.0. Am I doing it wrong? Any ideas? |
This also is not working for me either. Any ideas? My code is basically the same as @taddgiles above. I should note however that there is no remember_token in the DB nor is the password set (as this is an omniauth login only application)– is that a problem in this case/for this solution? |
I have the same issue as @taddgiles and @krnjn. I noticed that the cookie is created when signing up with omni-auth but it disappears when closing/opening the browser. So far, I solved this problem by setting Is there any other way to do this? |
it works for me but I do have remember_token in model's table |
I had issues with this as well. It turns out I was blindly setting the secure flag, which means the cookie is not available in development. The solution was to edit |
It raises the following error without remember token. |
For the record, I only had the
It is so hard to find a clear explanation of this that I'm sure I'll thank my future self for this comment. |
There seems to be some confusion on how to get remember me working with Omniauth.
According to this wiki, you need to have the following in your OmniauthCallbacksController:
On the other hand, according to this issue, you just need to do this:
In addition, making remember_me default to true according to this, you just need to add the following to your User.rb
Not sure which one is the official answer, and all three doesn't work for me. It only works for Chrome on Mac, but doesn't for Firefox Mac & Chrome Windows. Not sure what is going on.
My code looks like this:
The text was updated successfully, but these errors were encountered: