Pow v1.0.21 PowEmailConfirmation.Plug View Source
Plug helper methods.
Link to this section 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.
Link to this section Functions
confirm_email(conn, params)
View Sourceconfirm_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.
email_unconfirmed?(conn)
View Sourceemail_unconfirmed?(Plug.Conn.t()) :: boolean()
Check if the email for the current user is yet to be confirmed.
load_user_by_token(conn, signed_token)
View Sourceload_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
.
pending_email_change?(conn)
View Sourcepending_email_change?(Plug.Conn.t()) :: boolean()
Check if the there is a pending email change for the current user.
sign_confirmation_token(conn, map)
View Sourcesign_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
.