Skip to content

fix: use config.SiteURL instead of externalURL for send_email hook payload#2559

Open
yonatan-genai wants to merge 1 commit into
supabase:masterfrom
yonatan-genai:fix/send-email-hook-site-url
Open

fix: use config.SiteURL instead of externalURL for send_email hook payload#2559
yonatan-genai wants to merge 1 commit into
supabase:masterfrom
yonatan-genai:fix/send-email-hook-site-url

Conversation

@yonatan-genai
Copy link
Copy Markdown

Fixes #2558.

The send_email hook payload's email_data.site_url is populated from API_EXTERNAL_URL (e.g. https://<ref>.supabase.co/auth/v1) instead of GOTRUE_SITE_URL (e.g. https://myapp.com).

The SMTP template path gets this right — {{ .SiteURL }} resolves from GOTRUE_SITE_URL. The hook path doesn't, it pulls from API_EXTERNAL_URL instead.

So if you're using the hook to build confirmation links from site_url, they point to the auth server instead of your app. The field is called site_url but it's not the site URL.

One-line fix: externalURL.String()config.SiteURL.

@yonatan-genai yonatan-genai requested a review from a team as a code owner June 1, 2026 18:06
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

Successfully merging this pull request may close these issues.

send_email hook payload site_url uses API_EXTERNAL_URL instead of GOTRUE_SITE_URL

1 participant