Issue: the code for validating the session is getting repeated in all api routes
Integrate a middleware to validate the session on each API route.
Refer the Nextjs DOCS - https://nextjs.org/docs/app/building-your-application/routing/middleware
Test all API routes before PR and include a video of testing one or two apis
Expected output
All routes must validate the session before proceeding with further execution.
Issue: the code for validating the session is getting repeated in all api routes
Integrate a middleware to validate the session on each API route.
Refer the Nextjs DOCS - https://nextjs.org/docs/app/building-your-application/routing/middleware
Test all API routes before PR and include a video of testing one or two apis
Expected output
All routes must validate the session before proceeding with further execution.