Auth redirect and Additional Redirect URLs #6088
|
When you set up the basic Supabase magic link Auth example you get redirected to But it's quite likely that you will do local development while the service is later live. Which means this setting cannot be changed. There must be a way to log in locally, while also having a live service? I'm using JS/TS nextjs btw. |
Replies: 8 comments 1 reply
|
I'm bumping into the exact same issue. Help would be greatly appreciated. |
|
Within your You can substitute the value depending on your use case. Checking for your Source: https://supabase.com/docs/reference/javascript/auth-signin#sign-in-with-redirect |
|
@travishenson I thought so as well. However this does nothing. It might be that using "localhost" is not a viable option? So for some reason, this doesn't work for magic link logins. |
|
@cmdzro you are correct, it does work. I was having issues with string matching. Using I also agree having a wildcard |
|
For anyone else taking the Mastering Nuxt 3 course and finding this discussion, site url should be your actual netlify site url. Mine was defaulted to http://localhost:3000 because we never set it in the course. Then in the list of allowed redirect urls you have to be specific because wild cards are only supported for a sub domain as suggested above by jesper. So add the full url to the list So far, this is working for me so when I'm on my local dev it redirects to localhost and when I'm on my netlify app, it redirects there. |
|
I am using latest Supabase and this doc helps https://supabase.com/docs/guides/auth#redirect-urls-and-wildcards |
|
I spent forever trying to get this to work and managed to get it working on my project so will share and hopefully can be of some use. I'm deploying to vercel and was having the redirect issue across development previews and production deployment. Here's my implementation:
On supabase: Seems to be working for me so far 🤞 |
|
See in https://supabase.com/docs/guides/auth/concepts/redirect-urls Instead of your additional URL being http://localhost:3000/ you must add the glob to the end and make it: to match your actual auth URLs, or you can write the specific URL in place. |
@cmdzro you are correct, it does work. I was having issues with string matching. Using
redirectTo: window.location.origindidn't really work out. HardcodingredirectTo: 'http://localhost:3000/'did work however. Hope this helps others to get it to work!I also agree having a wildcard
*or possibly wildcard subdomainshttps://*.domain.comwould be a really nice addition.