Jumar.Accounts.User (Jumar v0.1.0)
View SourceDatabase schema for each individual registered user account.
Summary
Functions
Confirms the account by setting confirmed_at
.
A user changeset for registering or changing the email.
A user changeset for changing the password.
Verifies the password.
Types
@type t() :: %Jumar.Accounts.User{ __meta__: Ecto.Schema.Metadata.t(), authenticated_at: term(), confirmed_at: DateTime.t() | nil, email: String.t() | nil, hashed_password: String.t() | nil, id: Jumar.Types.TypeId.t() | nil, inserted_at: DateTime.t() | nil, password: String.t() | nil, updated_at: DateTime.t() | nil }
Functions
Confirms the account by setting confirmed_at
.
A user changeset for registering or changing the email.
It requires the email to change otherwise an error is added.
Options
:validate_unique
- Set to false if you don't want to validate the uniqueness of the email, useful when displaying live validations. Defaults totrue
.
A user changeset for changing the password.
It is important to validate the length of the password, as long passwords may be very expensive to hash for certain algorithms.
Options
:hash_password
- Hashes the password so it can be stored securely in the database and ensures the password field is cleared to prevent leaks in the logs. If password hashing is not needed and clearing the password field is not desired (like when using this changeset for validations on a LiveView form), this option can be set tofalse
. Defaults totrue
.
Verifies the password.
If there is no user or the user doesn't have a password, we call
Argon2.no_user_verify/0
to avoid timing attacks.