Skip to content

Can't generate url for email confirmation #731

@nesimtunc

Description

@nesimtunc

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions