Class: SimpleTokenAuthentication::DeviseFallbackHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_token_authentication/devise_fallback_handler.rb

Instance Method Summary collapse

Instance Method Details

#authenticate_entity!(controller, entity) ⇒ Object

Devise authentication is performed through a controller which includes Devise::Controllers::Helpers See rdoc.info/github/plataformatec/devise/master/\

Devise/Controllers/Helpers#define_helpers-class_method


13
14
15
# File 'lib/simple_token_authentication/devise_fallback_handler.rb', line 13

def authenticate_entity!(controller, entity)
  controller.send("authenticate_#{entity.name_underscore}!".to_sym)
end

#fallback!(controller, entity) ⇒ Object

Fallback to the Devise authentication strategies.



5
6
7
# File 'lib/simple_token_authentication/devise_fallback_handler.rb', line 5

def fallback!(controller, entity)
  authenticate_entity!(controller, entity)
end