Phauxth v0.8.1 Phauxth.Confirm.PassReset

Confirm a user and reset the password.

Options

There are two options:

  • identifier - how user is identified in the confirmation request

    • this should be an atom, and the default is :email
  • key_validity - the length, in minutes, that the token is valid for

    • the default is 60 minutes (1 hour)

Examples

Add the following command to the web/router.ex file:

resources "/password_resets", PasswordResetController, only: [:new, :create, :edit, :update]

Then add the following command to the password_reset_controller.ex file:

plug Phauxth.Confirm.PassReset when action in [:reset_password]

Or with options:

plug Phauxth.Confirm.PassReset, [identifier: :phone] when action in [:reset_password]