AuthShield v0.0.4 AuthShield.Credentials.Schemas.Password View Source

Password schema model.

We do not save users password, only the encripted hash that will be used to authenticate.

To see more about how we hash the password check Argon2.

Link to this section Summary

Types

t()

Abstract password module type.

Functions

Generates an Ecto.Changeset struct with the changes.

Generates an Ecto.Changeset to be used on assoc with the user.

Link to this section Types

Link to this type

t()

View Source
t() :: %AuthShield.Credentials.Schemas.Password{
  __meta__: term(),
  algorithm: String.t(),
  id: binary(),
  inserted_at: NaiveDateTime.t(),
  password: term(),
  password_hash: String.t(),
  updated_at: NaiveDateTime.t(),
  user: AuthShield.Resources.Schemas.User.t(),
  user_id: term()
}

Abstract password module type.

Link to this section Functions

Link to this function

changeset(model, params)

View Source
changeset(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset struct with the changes.

It defines validations and also generates the password hash if necessary.

Link to this function

changeset_assoc(model, params)

View Source
changeset_assoc(model :: t(), params :: map()) :: Ecto.Changeset.t()

Generates an Ecto.Changeset to be used on assoc with the user.

It defines validations and also generates the password hash if necessary.