code100x / muzer

https://muzer.100xdevs.com
184 stars 158 forks source link

chore: Extend JWT to store User Id & refactoring #76

Closed thepradipvc closed 1 month ago

thepradipvc commented 1 month ago

This PR does the following

  1. Adds User ID to the JWT token reducing db calls.
  2. Moved redirection logic on pages to server-side reducing the round trip of redirect from browser using hooks.
  3. Refactored codebase to separate main page route files (page.tsx within /app) from others like lib & components to reduce confusion in routing.

refactored to separate pages & others

NOTE: Adding a User ID to JWT takes place when the user signs in so change the NEXTAUTH_SECRET to make the older JWTs invalid as they don't contain a User ID.

SujithThirumalaisamy commented 1 month ago

LGTM, Can you please add the prisma singleton client here

thepradipvc commented 1 month ago

Hey @SujithThirumalaisamy I added the Prisma singleton client

SujithThirumalaisamy commented 1 month ago

Thankyou sir!