Coherence.PasswordController (Coherence v0.8.0)

Handle password recovery actions.

Controller that handles the recover password feature.

Actions:

  • new - render the recover password form
  • create - verify user's email address, generate a token, and send the email
  • edit - render the reset password form
  • update - verify password, password confirmation, and update the database

Summary

Functions

Create the recovery token and send the email

Render the password and password confirmation form.

Render the recover password form.

Verify the passwords and update the database

Types

@type conn() :: Plug.Conn.t()
@type params() :: map()
@type schema() :: Ecto.Schema.t()

Functions

Link to this function

clear_password_params(params \\ %{})

Link to this function

create(conn, params)

@spec create(conn(), params()) :: conn()

Create the recovery token and send the email

Link to this function

edit(conn, params)

@spec edit(conn(), params()) :: conn()

Render the password and password confirmation form.

Link to this function

new(conn, params)

@spec new(conn(), params()) :: conn()

Render the recover password form.

Link to this function

recover_password(conn, user_schema, user, params)

Link to this function

update(conn, params)

@spec update(conn(), params()) :: conn()

Verify the passwords and update the database