2010-03-03 11:57:23 +01:00
|
|
|
require 'active_support/core_ext/object/with_options'
|
|
|
|
|
|
|
|
Devise.with_options :model => true do |d|
|
|
|
|
# Strategies first
|
2010-07-13 10:09:55 +02:00
|
|
|
d.with_options :strategy => true do |s|
|
|
|
|
routes = [nil, :new, :destroy]
|
|
|
|
s.add_module :database_authenticatable, :controller => :sessions, :route => { :session => routes }
|
|
|
|
s.add_module :token_authenticatable, :controller => :sessions, :route => { :session => routes }
|
2010-03-03 11:57:23 +01:00
|
|
|
s.add_module :rememberable
|
|
|
|
end
|
|
|
|
|
2010-07-12 18:56:27 +02:00
|
|
|
# Other authentications
|
2010-09-25 16:08:46 +02:00
|
|
|
d.add_module :encryptable
|
2010-10-14 20:04:02 +02:00
|
|
|
d.add_module :omniauthable, :controller => :omniauth_callbacks, :route => :omniauth_callback
|
2010-07-12 18:56:27 +02:00
|
|
|
|
|
|
|
# Misc after
|
2010-07-13 10:09:55 +02:00
|
|
|
routes = [nil, :new, :edit]
|
|
|
|
d.add_module :recoverable, :controller => :passwords, :route => { :password => routes }
|
2010-07-15 22:00:20 +02:00
|
|
|
d.add_module :registerable, :controller => :registrations, :route => { :registration => (routes << :cancel) }
|
2010-03-03 11:57:23 +01:00
|
|
|
d.add_module :validatable
|
|
|
|
|
|
|
|
# The ones which can sign out after
|
2010-07-13 10:09:55 +02:00
|
|
|
routes = [nil, :new]
|
|
|
|
d.add_module :confirmable, :controller => :confirmations, :route => { :confirmation => routes }
|
|
|
|
d.add_module :lockable, :controller => :unlocks, :route => { :unlock => routes }
|
2010-04-03 13:11:45 +02:00
|
|
|
d.add_module :timeoutable
|
2010-03-03 11:57:23 +01:00
|
|
|
|
|
|
|
# Stats for last, so we make sure the user is really signed in
|
|
|
|
d.add_module :trackable
|
|
|
|
end
|