Sigra.Plug.RequirePasswordChange (Sigra v1.20.0)

Copy Markdown View Source

Plug that redirects users who must change their password.

When a user has must_change_password: true set on their record (typically by an admin via Sigra.Account.require_password_change/2), this plug calls the error handler with :must_change_password and halts the connection, forcing them to the password change form.

This mirrors the Sigra.Plug.RequireSudo pattern.

Options

Example

plug Sigra.Plug.RequirePasswordChange,
  error_handler: MyAppWeb.AuthErrorHandler

Summary

Functions

Check if user must change password and halt if so.

Initialize plug options.

Functions

call(conn, opts)

(since 0.8.0)

Check if user must change password and halt if so.

init(opts)

(since 0.8.0)

Initialize plug options.