Proca.Users.User (proca v3.4.1)

Link to this section Summary

Link to this section Functions

Link to this function

all(query, list)

Link to this function

confirm_changeset(user)

Confirms the account by setting confirmed_at.

Link to this function

details_changeset(user, attrs)

Link to this function

email_changeset(user, attrs)

A user changeset for changing the email.

It requires the email to change otherwise an error is added.

Link to this function

generate_password_changeset(user)

Link to this function

make_admin_changeset(user)

Link to this function

password_changeset(user, attrs, opts \\ [])

A user changeset for changing the password.

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 to false. Defaults to true.
Link to this function

perms_changeset(user, perms)

Link to this function

registration_changeset(user, attrs, opts \\ [])

A user changeset for registration.

It is important to validate the length of both email and password. Otherwise databases may truncate the email without warnings, which could lead to unpredictable or insecure behaviour. Long passwords may also 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 to false. Defaults to true.
Link to this function

registration_from_sso_changeset(user, attrs, opts \\ [])

Link to this function

valid_password?(arg1, password)

Verifies the password.

If there is no user or the user doesn't have a password, we call Bcrypt.no_user_verify/0 to avoid timing attacks.

Link to this function

validate_current_password(changeset, password)

Validates the current password otherwise adds an error to the changeset.

Link to this function

verify_pass(password, hashed_password)