Pow v1.0.16 PowEmailConfirmation.Phoenix.ControllerCallbacks View Source
Controller callback logic for e-mail confirmation.
User hasn't confirmed e-mail
Triggers on Pow.Phoenix.RegistrationController.create/2
or
Pow.Phoenix.SessionController.create/2
.
When a user is created or authenticated, and the current e-mail hasn't been
confirmed, a confirmation e-mail is sent, the session will be cleared, and the
user redirected back to Pow.Phoenix.Routes.after_registration_path/1
or
Pow.Phoenix.Routes.after_registration_path/1
respectively.
E-mail already taken during registration
Triggers on Pow.Phoenix.RegistrationController.create/2
.
When an error is returned during registration, and the changeset has an error
for the :email
field with the message has already been taken
, the user
will see the same success flow as above, but without any e-mail sent. This
will prevent information leak.
User updates e-mail
Triggers on Pow.Phoenix.RegistrationController.update/2
and
PowInvitation.Phoenix.InvitationController.update/2
When a user changes their e-mail, a confirmation e-mail is send to the new
e-mail, and an error flash is set for the conn. The same happens if the
PowInvitation
extension is enabled, and a user updates their e-mail when
accepting their invitation. It's assumed that the current e-mail for the
invited user has already been confirmed, see
PowInvitation.Ecto.Schema.invite_changeset/3
for more.
See PowEmailConfirmation.Ecto.Schema
for more.
Link to this section Summary
Functions
See Pow.Phoenix.Controller.messages/2
for more.
See Pow.Phoenix.Controller.routes/2
for more.
Sends a confirmation e-mail to the user.
Link to this section Functions
See Pow.Phoenix.Controller.messages/2
for more.
Pow.Phoenix.Messages
is used as fallback.
See Pow.Phoenix.Controller.routes/2
for more.
Pow.Phoenix.Routes
is used as fallback.
send_confirmation_email(user, conn)
View Sourcesend_confirmation_email(map(), Plug.Conn.t()) :: any()
Sends a confirmation e-mail to the user.
The user struct passed to the mailer will have the :email
set to the
:unconfirmed_email
value if :unconfirmed_email
is set.