View Source PowEmailConfirmation.Plug (Pow v1.0.36)
Plug helper functions.
Summary
Functions
Confirms the e-mail for the user.
Check if the email for the current user is yet to be confirmed.
Verifies the signed token and fetches user.
Check if the there is a pending email change for the current user.
Signs the e-mail confirmation token for public consumption.
Functions
@spec confirm_email(Plug.Conn.t(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()}
Confirms the e-mail for the user.
Expects user to exist in conn.assigns
for key :confirm_email_user
.
If successful, and a session exists, the session will be regenerated.
@spec email_unconfirmed?(Plug.Conn.t()) :: boolean()
Check if the email for the current user is yet to be confirmed.
@spec load_user_by_token(Plug.Conn.t(), binary()) :: {:ok, Plug.Conn.t()} | {:error, Plug.Conn.t()}
Verifies the signed token and fetches user.
If a user is found, it'll be assigned to conn.assigns
for key
:confirm_email_user
.
The token should have been signed with sign_confirmation_token/2
. The token
will be decoded and verified with Pow.Plug.verify_token/4
.
@spec pending_email_change?(Plug.Conn.t()) :: boolean()
Check if the there is a pending email change for the current user.
@spec sign_confirmation_token(Plug.Conn.t(), map()) :: binary()
Signs the e-mail confirmation token for public consumption.
The token will be signed using Pow.Plug.sign_token/4
.