vercel / nextjs-subscription-payments

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

Update helpers.ts for auth/callback #217

Closed gooodsoil closed 1 year ago

gooodsoil commented 1 year ago

Storing the user's session in a cookie does not work without this code.

This makes sure that getURL() when called in AuthUI.tsx redirects to the auth/callback endpoint.

Is this correct thinking? I noticed with out this I would have a buggy experience in my app

vercel[bot] commented 1 year ago

@gooodsoil is attempting to deploy a commit to the Vercel Solutions Team on Vercel.

A member of the Team first needs to authorize it.

thorwebdev commented 1 year ago

Thanks for noticing this! In our case it still works because we can also perform the code exchange client side, but you're right, better to do it in the callback. Fixing here: https://github.com/vercel/nextjs-subscription-payments/pull/218