1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Generate session routes for token authentication, but mark it as no_input.

This commit is contained in:
José Valim 2012-01-02 19:38:02 +01:00
parent 8b3e0e52f1
commit fd0e929087
2 changed files with 4 additions and 4 deletions

View file

@ -334,7 +334,7 @@ module Devise
#
def self.add_module(module_name, options = {})
ALL << module_name
options.assert_valid_keys(:strategy, :model, :controller, :route)
options.assert_valid_keys(:strategy, :model, :controller, :route, :no_input)
if strategy = options[:strategy]
strategy = (strategy == true ? module_name : strategy)
@ -346,7 +346,7 @@ module Devise
CONTROLLERS[module_name] = controller
end
NO_INPUT << strategy if strategy && controller != :sessions
NO_INPUT << strategy if options[:no_input]
if route = options[:route]
case route

View file

@ -5,8 +5,8 @@ Devise.with_options :model => true do |d|
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 }
s.add_module :rememberable
s.add_module :token_authenticatable, :controller => :sessions, :route => { :session => routes }, :no_input => true
s.add_module :rememberable, :no_input => true
end
# Other authentications