asciinema.org/config/initializers/warden.rb

14 lines
309 B
Ruby
Raw Normal View History

2014-02-20 22:00:44 +00:00
Warden::Manager.serialize_into_session do |user|
user.id
end
Warden::Manager.serialize_from_session do |id|
User.find_by_id(id)
end
require 'auth_cookie_strategy'
require 'api_token_strategy'
Warden::Strategies.add(:auth_cookie, AuthCookieStrategy)
Warden::Strategies.add(:api_token, ApiTokenStrategy)