How do I handle Vercel preview and Supabase auth?
See original GitHub issueHey there. I think this one is massively important and I am unsure why it wasnāt an issue before.
Nowadays most Continouous Deployments consist of automated deploys. Let it be on render.com on vercel.com or what not. Many of those create a preview URL such as some-hash.provider.ext
.
Now supabase expects a āgenericā base URL - which I would like to understand why because from an architectural perspective I think there should be only a list of āallowed URLsā and not necessarily a primary URL as the āprimaryā term is kinda not helpful (at least I am not seeing the advantage from an outside perspective).
Now since the Auth configuration in the UI is very static (input(Main URL), input(additional URLs)) there is no way of having a proper automated workflow - at all. There will always be manual work involved of adding more and more URLs.
IMO this can be even considered as āarchitectural flaw/bugā.
Iād be happy to help here if you point into the directions that need to be adapted. Other than that Iād be grateful if someone could pick that topic up, it is massively time-consuming and I am having a hard time understanding that this wasnāt a problem for other people so far.
Discussed in https://github.com/supabase/supabase/discussions/2760
<div type='discussions-op-text'>Originally posted by pedrobslisboa August 7, 2021 Hey guys, Iāve been looking for the answer to this question without success.
How do I handle Vercel preview and Supabase auth?
E.g.: How can I have the redirect URL for auth with google provider and sync to Vercel?

Issue Analytics
- State:
- Created 2 years ago
- Reactions:24
- Comments:37 (11 by maintainers)
Weāre really bumping into this issue with testing RLS and other auth features on Vercel preview URLs. Thereās really no workaround š
I got it! I donāt know what was hanging me up but setting the additional and then the env var does the trick. Thanks so much @kiwicopple šš¼