© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4mo ago•
4 replies
Peter

Magic Link emailRedirectTo Parameter Being Ignored

The emailRedirectTo parameter in the /auth/v1/otp API endpoint is completely ignored when sending magic link emails. This forces me to hardcode redirect URLs in the email template, making it impossible to support multiple
environments without manually changing the template.

What I've Tried:
- emailRedirectTo (camelCase) - Ignored
- email_redirect_to (snake_case) - Ignored
- Added URLs to Redirect URL whitelist - Still ignored
- Wildcard patterns (http://localhost:3000/**) - Still ignored

Current Implementation:
payload = {
"email": email,
"emailRedirectTo": redirect_url # Ignored
}
response = await client.post(f"{SUPABASE_URL}/auth/v1/otp", json=payload)

Current Workaround:
Hardcoding in email template:
<a href="https://PROJECT.supabase.co/auth/v1/verify?token={{ .TokenHash }}&type=magiclink&redirect_to=https://app.example.com/auth/callback">

The Problem:
- Cannot dynamically control redirect URLs from API
- Must manually edit template when switching local/production
- {{ .ConfirmationURL }} variable also doesn't respect API parameter

Questions:
1. Is this a known limitation or bug?
2. Is there a working way to pass dynamic redirect URLs?
3. What's the recommended approach for multi-environment setups?

Environment:
- Backend: Python/FastAPI
- Frontend: React

Expected Behavior:
emailRedirectTo should control redirect URLs like it does for OAuth providers.

This makes dev workflows difficult and requires manual intervention when switching environments. Any insights appreciated! 🙏
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Magic Link 403
SupabaseSSupabase / help-and-questions
6mo ago
Magic link email
SupabaseSSupabase / help-and-questions
4y ago
Magic Link redirects
SupabaseSSupabase / help-and-questions
4y ago
emailRedirectTo parameter not working - Supabase ignoring custom redirect urls
SupabaseSSupabase / help-and-questions
6mo ago