Module: Authpwn::UserModel
Overview
Included by the model class that represents users.
Parts of the codebase assume the model will be named User.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#auth_bounce_reason(crdential) ⇒ Object
Checks if a credential is acceptable for authenticating a user.
-
#set_default_exuid ⇒ Object
:nodoc: sets exuid to a (hopefully) unique value before validations occur.
-
#to_param ⇒ Object
Use e-mails instead of exposing ActiveRecord IDs.
Instance Method Details
#auth_bounce_reason(crdential) ⇒ Object
Checks if a credential is acceptable for authenticating a user.
Returns nil if the credential is acceptable, or a String containing a user-visible reason why the credential is not acceptable.
102 103 104 |
# File 'lib/authpwn_rails/user_model.rb', line 102 def auth_bounce_reason(crdential) nil end |
#set_default_exuid ⇒ Object
:nodoc: sets exuid to a (hopefully) unique value before validations occur.
112 113 114 115 |
# File 'lib/authpwn_rails/user_model.rb', line 112 def set_default_exuid self.exuid ||= Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '') end |
#to_param ⇒ Object
Use e-mails instead of exposing ActiveRecord IDs.
107 108 109 |
# File 'lib/authpwn_rails/user_model.rb', line 107 def to_param exuid end |