question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How do I handle Vercel preview and Supabase auth?

See original GitHub issue

Hey 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.

image

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?

Captura de Tela 2021-08-07 às 09 09 29 </div>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:24
  • Comments:37 (11 by maintainers)

github_iconTop GitHub Comments

10reactions
multiplehatscommented, Feb 2, 2022

We’re really bumping into this issue with testing RLS and other auth features on Vercel preview URLs. There’s really no workaround šŸ˜•

3reactions
travispamaralcommented, Jul 1, 2022

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 šŸ™šŸ¼

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I handle Vercel preview and Supabase auth? #2760
I figured one way: created a constant URL like preview.my-app.com and added that to the redirect call and additional domains in Supabase. Then...
Read more >
Supabase Authentication - Vercel
Supabase Authentication. This example shows how to use Supabase Auth on the client and server in both API Routes and when using server-side...
Read more >
Vercel - Supabase
From the Supabase popup, select your new Vercel Project and Supabase project from the dropdowns. Supabase integration. Step 3: Clone GitHub repo#. The...
Read more >
Deploy a Supabase Storage Example on Vercel - YouTube
Repo here: https://github.com/ supabase / supabase /tree/master/examples/nextjs-ts-user-managementSupabase Storage:Ā ...
Read more >
Configure Stripe for Production and Deploy Next.js Application ...
Create a function hook in Supabase to use our Vercel domain We now have a ... Implement Third Party Authentication with GitHub in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found