Sha256: 72449c76d40abb320e28bdef41f93588b98cf365944df0ddc73b081c2519b6fa

Contents?: true

Size: 623 Bytes

Versions: 8

Compression:

Stored size: 623 Bytes

Contents

module SimpleTokenAuthentication
  class DeviseFallbackHandler
    include Singleton

    # Fallback to the Devise authentication strategies.
    def fallback!(controller, entity)
      authenticate_entity!(controller, entity)
    end

    # Devise authentication is performed through a controller
    # which includes Devise::Controllers::Helpers
    # See http://rdoc.info/github/plataformatec/devise/master/\
    #            Devise/Controllers/Helpers#define_helpers-class_method
    def authenticate_entity!(controller, entity)
      controller.send("authenticate_#{entity.name_underscore}!".to_sym)
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
simple_token_authentication-1.18.1 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.18.0 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.17.0 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.16.0 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.15.1 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.15.0 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.14.0 lib/simple_token_authentication/devise_fallback_handler.rb
simple_token_authentication-1.13.0 lib/simple_token_authentication/devise_fallback_handler.rb