class MinimalistAuthentication::Configuration

Attributes

login_redirect_path[RW]

Where to route users after a successful login. Defaults to :root_path

logout_redirect_path[RW]

Where to route users after logging out. Defaults to :new_session_path

request_email[RW]

Check for users email at login and request if blank. Only useful if using username to login and users might not have an email set. Defaults to true

session_key[RW]

The session_key used to store the current_user id. Defaults to :user_id

user_model_name[RW]

The application user class name Defaults to ‘::User’

validate_email[RW]

Toggle all email validations. Defaults to true.

validate_email_presence[RW]

Toggle email presence validation. Defaults to true. Note: validate_email_presence is only checked if validate_email is true.

verify_email[RW]

Verify users email address at login. Defaults to true.

Public Class Methods

new() click to toggle source
# File lib/minimalist_authentication/configuration.rb, line 54
def initialize
  self.user_model_name          = "::User"
  self.session_key              = :user_id
  self.validate_email           = true
  self.validate_email_presence  = true
  self.request_email            = true
  self.verify_email             = true
  self.login_redirect_path      = :root_path
  self.logout_redirect_path     = :new_session_path
end

Public Instance Methods

email_prefix=(_) click to toggle source
# File lib/minimalist_authentication/configuration.rb, line 65
def email_prefix=(_)
  MinimalistAuthentication.deprecator.warn("The #email_prefix configuration setting is no longer supported.")
end
user_model() click to toggle source

Returns the user_model class Calling constantize on a string makes this work correctly with the Spring application preloader gem.

# File lib/minimalist_authentication/configuration.rb, line 72
def user_model
  user_model_name.constantize
end