moinulmoin / chadnext

ChadNext - Quick Starter Template for your Next project includes Next.js 14 App router, Shadcn UI, LuciaAuth, Prisma, Server Actions, Stripe, Internationalization and more.
https://chadnext.moinulmoin.com
MIT License
942 stars 90 forks source link

How to handle when user clicks cancel button the first time he logs in with githug? #216

Closed ilbrigz closed 3 months ago

ilbrigz commented 5 months ago

When a user clicks cancel during the authorization process I get redirected to a not found page.

moinulmoin commented 3 months ago

i guess that's expected, if someone cancels, it throws oauth callback error, you can handle that here https://github.com/moinulmoin/chadnext/blob/main/src/app/api/auth/login/github/callback/route.ts , line 95