class SimpleTokenAuthentication::DeviseFallbackHandler

Public Instance Methods

authenticate_entity!(controller, entity) click to toggle source

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
# 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) click to toggle source

Fallback to the Devise authentication strategies.

# File lib/simple_token_authentication/devise_fallback_handler.rb, line 6
def fallback!(controller, entity)
  authenticate_entity!(controller, entity)
end