using a local development setup, auth.site_url in config.toml is not used in ConfirmationURL
in the config.toml i can see the following property that i've tried changing and it has no effect:
[auth]
enabled = true
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
# in emails.
site_url = "mylocalsite.app"
if i use {{ .SiteURL }} in a custom template, it outputs the mylocalsite.app, but {{ .ConfirmationURL }} always has the http://127.0.0.1
Please only open a discussion or an issue, opening both makes the query harder to answer and can waste the time of maintainers and contributors.
I will close this and the answer can be provided in the linked discussion
@encima wouldn't this be considered a bug? maybe it'd make more sense to close the discussion and leave this issue open?
@encima i also saw you added the self-hosted tag and this is not the case. i clearly state in the title this is about a "local development" setup issue.
i have closed the discussion and placed more detail here. would appreciate some feedback.
Thanks for that, let's continue in the issue then. The self-hosted tag is more because it is not on the hosted platform (though it may be better to add another label to differentiate)
Hello! Running into the same issue here. Digging into the CLI code a little bit, it seems that GoTrue is getting it's external URL from a the config Api.ExternalURL
https://github.com/supabase/cli/blob/230be7f40f251774b94a5ecc5b8025c4da22e58e/internal/start/start.go#L465
There seems to be a config.toml section to set this URL here ([api].external_url)
https://github.com/supabase/cli/blob/230be7f40f251774b94a5ecc5b8025c4da22e58e/pkg/config/config.go#L148
but at the same time it seems to be overwritten a few lines down
https://github.com/supabase/cli/blob/230be7f40f251774b94a5ecc5b8025c4da22e58e/pkg/config/config.go#L636
which is ultimately fetched from the Docker.DaemonHost
https://github.com/supabase/cli/blob/230be7f40f251774b94a5ecc5b8025c4da22e58e/internal/utils/misc.go#L303
I'm not sure how we can change this hostname, as a workaround...
This has caused me a lot of headache as well, I've got a work around but it's kind of annoying. I'm running Windows 10, so if you're using another OS there may need to be some slight adjustments.
- First I started supabase as normal
- Using Docker Desktop, I went to the supabase_auth_musician-app container, and in the container actions I clicked on "Copy docker run", and pasted the command into a script.
- Then I manually changed any reference to http://127.0.0.1:54321 with my desired target url, which for me was my dev computers ip and the api port (http://192.168.50.174:54321). I think you'd be able to get away with just changing the following values though
API_EXTERNAL_URL=[TARGET_URL]
GOTRUE_JWT_ISSUER=[TARGET_URL]/auth/v1
GOTRUE_MAILER_URLPATHS_CONFIRMATION=[TARGET_URL]/auth/v1/verify
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE=[TARGET_URL]/auth/v1/verify
GOTRUE_MAILER_URLPATHS_RECOVERY=[TARGET_URL]/auth/v1/verify
GOTRUE_MAILER_URLPATHS_INVITE=[TARGET_URL]/auth/v1/verify
- After changing all the required env values in the run command, I added
--name supabase_auth_musician-appto the command. It won't work if you don't do this. - I put the value for GOTRUE_SMS_TEMPLATE in quotes.
- remove or replace any env function calls with their appropriate values (e.g.
--env=GOTRUE_EXTERNAL_APPLE_SECRET=env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)becomes--env=GOTRUE_EXTERNAL_APPLE_SECRET=[HARDCODED_SECRET]) - I then removed the old supabase_auth_musician-app container
- I then ran my script to spin up the new container
This process seems to be working for me, for now. I normally use GitBash but had to use powershell to get this to work, because GitBash couldn't figure out how to work with the --workdir flag. Any errors I ran into during this process were due to formatting, so make sure there's nothing that needs to be quoted, escaped, etc if you run into issues.
Hi, I've moved this issue over from the supabase repo as it seems cli related
I can confirm this, site_url is ignored. Fix?
config.toml
site_url = "http://127.0.0.1:3000"
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
additional_redirect_urls = ["https://127.0.0.1:3000", "up-for-it://auth/callback", "https://up-for.it/"]
call in code
await _supabase.auth.signInWithOtp(email: email, emailRedirectTo: 'https://up-for.it/');
log from supabase_auth container
{"auth_event":{"action":"user_recovery_requested","actor_id":"b39393fa-4453-4aac-93eb-5b2cf25d0684","actor_name":"Niklas Raab","actor_username":"[email protected]","actor_via_sso":false,"log_type":"user"},"component":"api","duration":1540570125,"level":"info","method":"POST","msg":"request completed","path":"/otp","referer":"https://up-for.it/","remote_addr":"95.90.193.207","request_id":"c3524838-9f16-43a7-859d-2fc54d03fa13","status":200,"time":"2025-11-24T09:33:19Z"}
url in the magic email
http://127.0.0.1:54321/auth/v1/verify?token=pkce_74d1b676a706d860b7fc162cbcf60ba1c8b14900e8020fc0348083e6&type=magiclink&redirect_to=https://up-for.it/
More context why this is important to work:
I have a cloudflare tunnel open, so that i can connect my app to the locally running supabase instantance. I need to change the site_url to the tunnel url so that it's available from my phone. Using emulator doesn't work as well, because emulator can't receive emails and localhost is not available on emulator either.