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:
parent
8b3e0e52f1
commit
fd0e929087
2 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue