nextjs-subscription-payments icon indicating copy to clipboard operation
nextjs-subscription-payments copied to clipboard

Error in redirect when using Google auth provider

Open reveurguy opened this issue 2 years ago • 3 comments
trafficstars

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.

reveurguy avatar Jul 14 '23 14:07 reveurguy

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.

hinetapora avatar Jul 28 '23 14:07 hinetapora

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

nate-oo avatar Oct 25 '23 17:10 nate-oo

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)

ajayvignesh01 avatar Oct 26 '23 14:10 ajayvignesh01