IVR

IVR

Pow API email confirmation flow

Hi all,

I’m currently building a Phoenix API that uses Pow for authentication. I’ve enjoyed working with Pow so far, but I’m at the point where I need to create an email confirmation flow and I’ve found this document that provides useful information on how to do it. However, the document also points out the following problems:

  • There is currently no “change email” flow
  • There is no login denial for unconfirmed emails
  • There is no way to resend a confirmation email

Before I dive into it, I wanted to check if anyone has managed to overcome these 3 problems and if so, then I’d appreciate any tips or resources. I think the 2nd one should be pretty straightforward, I could just update the session creation call to check for the confirmation status. As for the other two, I think they are connected, because if a user changes their email, then you’d need to (1) reset their confirmation token and confirmation status, (2) then send the new token to their new address.

Any suggestions would be highly appreciated :slight_smile:

Many thanks

Marked As Solved

akashv

akashv

For re sending confirmation emails you can use the controller from Resend email confirmation link | Pow.

As you said, login denial (better option would be denying authorization, that way users who have not confirmed email can still log in and request re sending of confirmation email)should be easy to implement with a custom plug on routes you want blocked to unconfirmed users.

As for changing email you will have to follow Pow.Phoenix.RegistrationController.update/2 as it triggers the confirmation email if it is updated.

Last Post!

IVR

IVR

Excellent, thank you!

Where Next?

Popular in Questions Top

minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New

Other popular topics Top

vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49266 226
New
msaraiva
Surface is an experimental library built on top of Phoenix LiveView and its new LiveComponent API that aims to provide a more declarative...
564 44265 214
New

We're in Beta

About us Mission Statement