Pow v1.0.1 PowResetPassword.Plug View Source
Plug helper methods.
Link to this section Summary
Functions
Assigns a :reset_password_user
key with the user in the connection
Creates a changeset from the user fetched in the connection
Finds a user for the provided params, creates a token, and stores the user for the token
Fetches the assigned :reset_password_token
in the connection
Updates the password for the user fetched in the connection
Fetches user from the store by the provided token
Link to this section Functions
assign_reset_password_user(conn, user)
View Source
assign_reset_password_user(Plug.Conn.t(), map()) :: Plug.Conn.t()
assign_reset_password_user(Plug.Conn.t(), map()) :: Plug.Conn.t()
Assigns a :reset_password_user
key with the user in the connection.
change_user(conn, params \\ %{})
View Source
change_user(Plug.Conn.t(), map()) :: map()
change_user(Plug.Conn.t(), map()) :: map()
Creates a changeset from the user fetched in the connection.
create_reset_token(conn, params)
View Source
create_reset_token(Plug.Conn.t(), map()) ::
{:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
create_reset_token(Plug.Conn.t(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
Finds a user for the provided params, creates a token, and stores the user for the token.
reset_password_token(conn)
View Source
reset_password_token(Plug.Conn.t()) :: binary()
reset_password_token(Plug.Conn.t()) :: binary()
Fetches the assigned :reset_password_token
in the connection.
update_user_password(conn, params)
View Source
update_user_password(Plug.Conn.t(), map()) ::
{:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
update_user_password(Plug.Conn.t(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
Updates the password for the user fetched in the connection.
user_from_token(conn, token)
View Source
user_from_token(Plug.Conn.t(), binary()) :: map() | nil
user_from_token(Plug.Conn.t(), binary()) :: map() | nil
Fetches user from the store by the provided token.