module Jennifer::Model::Authentication

Defined in:

jennifer/model/authentication.cr

Constant Summary

Password = {type: ::Union(String, ::Nil), virtual: true, setter: false}

Password virtual attribute type definition.

PASSWORD_RANGE = Crypto::Bcrypt::PASSWORD_RANGE.min...Crypto::Bcrypt::PASSWORD_RANGE.max

Macro Summary

Macro Detail

macro with_authentication(password = "password", password_hash = "password_digest", skip_validation = false) #

Adds methods to set and authenticate against a Crypto::Bcrypt password.

  • password - password field name (default is "password");
  • password_hash - password digest attribute name (default is "password_digest");
  • skip_validation - whether validations shouldn't be generated (default is false).

[View source]