Password reset redirectTo URL not including path component
When using resetPasswordForEmail(), the redirectTo URL is being truncated and not including the path I specify.
Code:
Expected redirect URL:
https://my.app/authenticate/updatePassword
Actual URL in email:
https://xxx.supabase.co/auth/v1/verify?token=...&type=recovery&redirect_to=https://my.app/
The path /authenticate/updatePassword is being stripped. VITE_APP_URL is correctly set to https://my.app/.
Config:
- Using Vite
- Email confirmation is working ✅
- Only the redirect path is missing
Is there a configuration setting I'm missing, or do redirect URLs need to be added to an allowlist somewhere?
It successfully sends the email to the user ✅
The redirect URL is almost correct but not quite, the final part of the url ends up missing my "/authenticate/updatePassword":
https://asdlfkassdlkfj.supabase.co/auth/v1/verify?token=5fd9ffa7464a513c1977ac88503c52264691488e2e882c479490278d&type=recovery&redirect_to=https://my.app/
my VITE_APP_URL is correctly identified as https://my.app/ but the string i've added on the end is not being appended.
My reset password template is:
2 Replies
You need to add the exact URL inside of the Supabase dashboard under the
Redirect URLs section. It needs to be exactly https://my.app/authenticate/updatePassword
Redirect URLs section: https://supabase.com/dashboard/project/_/auth/url-configurationThank you for your response, I will try this as I currently only had it wildcarded 👍
my Redirect URLs are now:
https://my.app/authenticate/updatePassword
it still only redirects me to
https://my.app/
every time
it could be because
import.meta.env.VITE_APP_URL + "/authenticate/updatePassword"
adds the / to the VITE_APP_URL, where the redirect url seems to have a trailing slash (https://my.app/)
Fixed, the above worked after some configuring. Thanks Silentworks