Skip to content

emailRedirectTo is ignored during signUp() confirmation email, but works correctly for resetPasswordForEmail() #2634

Description

@RamK07-2007

Bug description

Using Supabase JS v2.110.7 on GitHub Pages.

My signup code is:

let { data, error } = await supabase.auth.signUp({
  email,
  password,
  options: {
    data: { nombre },
    emailRedirectTo: "https://<github-pages-site>/<repository>/"
  }
});

The request payload contains:

{
  "email": "...",
  "password": "...",
  "data": {
    "nombre": "..."
  },
  "email_redirect_to": "https://<github-pages-site>/<repository>/"
}

However, the confirmation email generated by Supabase always contains:

https://<project>.supabase.co/auth/v1/verify?...&redirect_to=https://<github-pages-site>/

instead of:

https://<github-pages-site>/<repository>/

The account is successfully created and the email is confirmed, but the redirect ignores the repository path.

Interestingly, password reset works correctly:

await supabase.auth.resetPasswordForEmail(email, {
  redirectTo: "https://<github-pages-site>/<repository>/"
});

and redirects to /repository/ as expected.

What I've already verified

  • Supabase JS v2.110.7
  • Site URL is https://<github-pages-site>/<repository>/
  • Redirect URLs include https://<github-pages-site>/<repository>/
  • The browser request payload contains the correct email_redirect_to
  • window.location.href is https://<github-pages-site>/<repository>/
  • The issue occurs both with supabase.auth.signUp() and a direct POST /auth/v1/signup request.

Email setup

I'm using the default Supabase email service and default email templates.

I do not have a custom SMTP server or a custom domain, so I cannot customize the confirmation email template. I'm relying entirely on the built-in Supabase email provider.

Project reference: bzmvnsgqtflpknnqadrj

Is there any known reason why signup confirmation emails ignore emailRedirectTo while password reset emails correctly respect redirectTo?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions