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:
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 ignoredCurrent 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 parameterQuestions:
- Is this a known limitation or bug?
- Is there a working way to pass dynamic redirect URLs?
- What's the recommended approach for multi-environment setups?Environment:
- Backend: Python/FastAPI
- Frontend: ReactExpected 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!