Sha256: 0bcdbd2c0cdd3a4fd41730f12d5436dae40b60a1e787f973f79874325ab1de52

Contents?: true

Size: 1004 Bytes

Versions: 19

Compression:

Stored size: 1004 Bytes

Contents

require 'active_support/deprecation'
require 'simple_token_authentication/token_authentication_handler'

module SimpleTokenAuthentication
  module ActsAsTokenAuthenticationHandler

    # This module ensures that no TokenAuthenticationHandler behaviour
    # is added before the class actually `acts_as_token_authentication_handler_for`
    # some token authenticatable model.
    # See https://github.com/gonzalo-bulnes/simple_token_authentication/issues/8#issuecomment-31707201

    def acts_as_token_authentication_handler_for(model, options = {})
      include SimpleTokenAuthentication::TokenAuthenticationHandler
      handle_token_authentication_for(model, options)
    end

    def acts_as_token_authentication_handler
      ::ActiveSupport::Deprecation.warn "`acts_as_token_authentication_handler()` is deprecated and may be removed from future releases, use `acts_as_token_authentication_handler_for(User)` instead.", caller
      acts_as_token_authentication_handler_for User
    end
  end
end

Version data entries

19 entries across 19 versions & 2 rubygems

Version Path
simple_token_authentication-1.18.1 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.18.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.17.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.16.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.15.1 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.15.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.14.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.13.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.12.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.11.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.10.1 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.10.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.9.1 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.9.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.8.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
stn-simple_token_authentication-1.7.1 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.7.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.6.0 lib/simple_token_authentication/acts_as_token_authentication_handler.rb
simple_token_authentication-1.5.2 lib/simple_token_authentication/acts_as_token_authentication_handler.rb