vercel / nextjs-subscription-payments

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

Error in redirect when using Google auth provider #219

Open reveurguy opened 1 year ago

reveurguy commented 1 year ago

I am using Google provider for auth. When i signin, I want to redirect to /dashboard. How can i do that? Currently it redirects to homepage only. Also is there any common setting to manage the redirect because i want my default redirect after any auth signup to /dashboard.

hinetapora commented 11 months ago

Bard has a pages based answer for this prompt that you might be able to implement in the app router: Using https://vercel.com/templates/next.js/subscription-starter redirect after login open the account page.

nate-oo commented 8 months ago

@reveurguy did you figure this out. I am trying to do the same thing.

ajayvignesh01 commented 8 months ago

Change this line in "app/auth/callback/route.ts" with the route/url you want to redirect to:

// URL to redirect to after sign in process completes
  return NextResponse.redirect(requestUrl.origin)