Method: Authenticate::Configuration#authentication_strategy

Defined in:
lib/authenticate/configuration.rb

#authentication_strategySymbol or Class

Strategy for authentication.

Available strategies:

  • :email - requires user have attribute :email

  • :username - requires user have attribute :username

Defaults to :email. To set to :username:

Configuration.configure do |config|
  config.authentication_strategy = :username
end

Authenticate is designed to authenticate via :email. Some support for username is included. Username still requires an :email attribute on your User model.

Alternatively, you can plug in your own authentication class:

Configuration.configure do |config|
  config.authentication_strategy = MyFunkyAuthClass
end


182
183
184
# File 'lib/authenticate/configuration.rb', line 182

def authentication_strategy
  @authentication_strategy
end