class MinimalistAuthentication::Configuration
Attributes
Where to route users after a successful login. Defaults to :root_path
Where to route users after logging out. Defaults to :new_session_path
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
The session_key
used to store the current_user id. Defaults to :user_id
The application user class name Defaults to ‘::User’
Toggle all email validations. Defaults to true.
Toggle email presence validation. Defaults to true. Note: validate_email_presence
is only checked if validate_email
is true.
Verify users email address at login. Defaults to true.
Public Class Methods
# 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
# File lib/minimalist_authentication/configuration.rb, line 65 def email_prefix=(_) MinimalistAuthentication.deprecator.warn("The #email_prefix configuration setting is no longer supported.") end
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