Created
May 2, 2011 00:27
-
-
Save jamiew/951032 to your computer and use it in GitHub Desktop.
Monkeypatch Devise so HTTP authentication sets remember_user_token cookie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/devise_http_rememberable.rb | |
# ABR: Always Be Remembering | |
module Devise | |
module Strategies | |
class Authenticatable < Base | |
def remember_me? | |
# Devise's implementation of this is: | |
# valid_params? && Devise::TRUE_VALUES.include?(params_auth_hash[:remember_me]) | |
# which only works for param authentication, not http authentication | |
true | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment