Created
May 19, 2011 22:39
-
-
Save jamiew/981968 to your computer and use it in GitHub Desktop.
Monkeypatch Devise to support saving sessions via HTTP auth (e.g. via bookmarklets or browser addons)
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 | |
# Monkeypatch Devise so HTTP authentication sets remember_user_token cookie | |
# 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