pow-auth / pow

Robust, modular, and extendable user authentication system
https://powauth.com
MIT License
1.58k stars 152 forks source link

Can't generate url for email confirmation #731

Open nesimtunc opened 2 months ago

nesimtunc commented 2 months ago

Hello,

I'm using PowEmailConfirmation extension here's the generated template:

defmodule MyAppWeb.PowEmailConfirmationMail do
  use MyAppWeb, :mail

  def email_confirmation(assigns) do
    %Pow.Phoenix.Mailer.Template{
      subject: "Confirm your email address",
      html: ~H"""
        <h3>Hi</h3>
        <p>Please use the following link to confirm your e-mail address:</p>
        <p><a href="<%= @url %>"><%= @url %></a></p>
        """,
      text: ~P"""
        Hi,

        Please use the following link to confirm your e-mail address:

        <%= @url %>
        """
    }
  end
end

The generated url: http://localhost:4000/confirm-email/en where en is the default locale.

Here's my router:


scope "/" do
    pipe_through :browser

    pow_routes()
    pow_extension_routes()
  end

  scope "/:locale" do
    pipe_through :browser

    pow_routes()
    pow_extension_routes()
  end

With / without :locale it's same. I can't find why it's not putting token in the url and when I manually call the url something like this: http://localhost:4000/confirm-email/e845069a-65be-4f2a-bd27-971e8e9527f1 it says invalid, probably it's because of the salt.

I couldn't find how you generate that url in your code. I assume these there files are the related one:

Any help would be appreciated. Thank you.