Closed ghost closed 7 years ago
Sorry about the delay in getting back to you.
There's an example of how to handle confirmation here, but it might be helpful to give you some idea of the workflow:
Mailler.ask_confirm
function will send an email, with a confirmation link, to the user.confirm_email
route.confirm_email
route in the session_controller, which runs the Openmaize.ConfirmEmail
function, which checks the key, adds the current date to confirmed_at
and then sends a reply email to the user.Each subsequent login then checks the user's confirmed_at
value. If it is nil, the login fails. There's no need for an additional confirmed
boolean value in the schema.
As the title says, I'm quite a newbie in Phoenix / Elixir. How would you proceed on creating the functionality which verifies the confirmation link that is sent by
ask_confirm
? I am not looking for a full-fledged tutorial, but a small top-level explanation.I imagine you could have a function which is associated with a route that is supposed to receive the link and then add the current date to
:confirmed_at
? Would it be a good idea to add aconfirmed
boolean to the User schema and then switch the boolean to true when the user accesses the link sent in the email?Thanks in advance!