Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate url for email confirmation #731

Open
nesimtunc opened this issue May 5, 2024 · 0 comments
Open

Can't generate url for email confirmation #731

nesimtunc opened this issue May 5, 2024 · 0 comments

Comments

@nesimtunc
Copy link

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:

  • lib/extensions/email_confirmation/phoenix/controllers/confirmation_controller.ex
  • lib/extensions/email_confirmation/plug.ex
  • lib/extensions/email_confirmation/phoenix/router.ex

Any help would be appreciated.
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant