Kiranism / next-shadcn-dashboard-starter

Admin Dashboard Starter with Nextjs14 and shadcn ui
https://next-shadcn-dashboard-starter.vercel.app
MIT License
1.43k stars 302 forks source link

"redirect_uri_mismatch" Error from Github OAuth #2

Closed hitesh-c closed 5 months ago

hitesh-c commented 5 months ago

Hi, I tried deploying this repository, But I am facing a error with Next Auth. My application is redirecting to this after successful Login with Github. Please help me

https://next-dashboard-pi-nine.vercel.app/?callbackUrl=https://next-dashboard-pi-nine.vercel.app/dashboard?error_description=The+redirect_uri+MUST+match+the+registered+callback+URL+for+this+application.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23redirect-uri-mismatch&state=DgW_BIG6i0ULFBuA0xEl2ArAVOAFKNbkCesB-RRLyYo&error=redirect_uri_mismatch

Kiranism commented 5 months ago

Did you setup github config for oauth? https://next-auth.js.org/providers/github#configuration https://github.com/settings/developers

hitesh-c commented 5 months ago

Thanks for replying,

Yes, I did. NextAuth is redirecting back to same homepage URL with query params code and state. I am not able to find out why it is not redirecting to dashboard like your deployed version. I have just started learning next.JS

Kiranism commented 5 months ago

Make sure to mention your callback URL in the GitHub OAuth settings. Check if you have configured it correctly with your hosted app, like this in the Authorization callback URL:

https://domain/api/auth/callback/github

hitesh-c commented 5 months ago

Thanks, It is solved.