vercel / nextjs-subscription-payments

Clone, deploy, and fully customize a SaaS subscription application with Next.js.
https://subscription-payments.vercel.app/
MIT License
6.08k stars 1.23k forks source link

How do you authenticate in a local development environment? #166

Open danielmguerrero opened 1 year ago

danielmguerrero commented 1 year ago

I'm trying to develop my custom nextjs app from this repository, but I don't find the way to handle the authentication process in a development environment.

In my case, Twitter handle the callback redirection and I can't find the way to point localhost instead of the production site. So, when I login in local the app authenticates me in production. Supabase doesn't have any way to handle some Twitter dev credentials.

What's your approach to do this?

thngdude commented 1 year ago

I don't have a proper answer, but I added http://localhost:3000 under Auth > URL Config > Redirect URLs, then whenever I issue a magic link, I manually change the redirect URL to the localhost.

Would also appreciate a proper solution for local dev, but this will work in the meantime (at least for magic link auth).

chriscarrollsmith commented 9 months ago

Authentication > URL Configuration >Site URL is the correct place to add http://localhost:3000/. Put it in the Site URL field and his "save". This is "the default redirect URL used when a redirect URL is not specified or doesn't match one from the allow list."