Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwim/520483 to your computer and use it in GitHub Desktop.
Save pwim/520483 to your computer and use it in GitHub Desktop.
odule Authlogic::Session::Timeout::DontLockoutApiKeyOrHttpAuth
def self.included(klass)
klass.class_eval do
dont_lockout = "single_access? || persist_by_http_auth?"
before_persisting_callback_chain.detect {|c| c.method == :reset_stale_state }.options.update(:unless => dont_lockout)
after_persisting_callback_chain.detect {|c| c.method == :enforce_timeout }.options.update(:unless => dont_lockout)
end
end
end
class Authlogic::Session::Base
include Authlogic::Session::Timeout::DontLockoutApiKeyOrHttpAuth
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment