Class: SimpleTokenAuthentication::DeviseFallbackHandler

Inherits:
Object
  • Object
show all
Includes:
Singleton
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


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

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

#fallback!(controller, entity) ⇒ Object

Fallback to the Devise authentication strategies.



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

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