Skip to content

Instantly share code, notes, and snippets.

@mytrile
Created November 9, 2012 08:53
Show Gist options
  • Save mytrile/4044557 to your computer and use it in GitHub Desktop.
Save mytrile/4044557 to your computer and use it in GitHub Desktop.
Cookie based authentication strategy in Devise
# config/application.rb
module YourApp
class Application < Rails::Application
config.autoload_paths += %W(#{config.root}/lib/devise)
# rest of the file
end
end
# config/initializers/devise.rb
Devise.setup do |config|
config.warden do |manager|
manager.default_strategies(:scope => :user).unshift :token_cookie_strategy
end
# rest fo the file
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment