Password Reset redirectTo Parameter Not Working

Hi! I'm having an issue with password reset emails where the redirectTo parameter isn't being respected. What I'm doing:
requestBody := map[string]string{
"email": "user@example.com",
"redirectTo": "http://localhost:5173/auth/callback",
}
requestBody := map[string]string{
"email": "user@example.com",
"redirectTo": "http://localhost:5173/auth/callback",
}
What I expect: Email link should redirect to http://localhost:5173/auth/callback What I get: Email link only redirects to http://localhost:5173 (missing the /auth/callback path) The email URL looks like: https://myproject.supabase.co/auth/v1/verify?token=...&type=recovery&redirect_to=http://localhost:5173 What I've tried: Supabase Go community package (https://github.com/supabase-community/supabase-go) - doesn't support redirectTo parameter Direct HTTP calls to /auth/v1/recover endpoint - still not working My settings: Site URL: http://localhost:5173 Redirect URLs: includes http://localhost:5173/auth/callback Email template uses {{ .ConfirmationURL }} Questions: Is redirectTo the correct parameter name for the /auth/v1/recover endpoint? Could my Site URL setting be overriding the redirectTo parameter? Any other configuration I'm missing? Thanks
GitHub
GitHub - supabase-community/supabase-go: A Go Client library for Su...
A Go Client library for Supabase. Contribute to supabase-community/supabase-go development by creating an account on GitHub.
4 Replies
silentworks
silentworks2w ago
Yes it doesn't look like the community managed Go SDK supports this. The actual endpoint would take a redirect_to and not a redirectTo.
garyaustin
garyaustin2w ago
You are calling Auth REST API directly? https://github.com/supabase/auth You might try redirect_to.
silentworks
silentworks2w ago
You can find the /recover endpoint here https://github.com/supabase/auth?tab=readme-ov-file#post-recover but there is no mention of the redirect_to although it does exist on this endpoint. So I'd like to think this documentation is not fully up to date. Note that it's not included because it's not a part of the payload body but rather a part of the query string. So the endpoint should be
/auth/v1/recover?redirect_to=http://localhost:5173/auth/callback
/auth/v1/recover?redirect_to=http://localhost:5173/auth/callback
Mansour
MansourOP2w ago
Aha alright thanks guys will test it out

Did you find this page helpful?