Next.js Discord

Discord Forum

Auth.js + Next.js 13 - Question about direction and usage

Unanswered
Burmese posted this in #help-forum
Open in Discord
BurmeseOP
I currently have a project in the works using Next.js 13.5.6 and Auth.js. It is one of my starter projects with Auth.js. I managed to customize the Auth.js to use MongoDB + server sessions and stay away from JWT due to the information exposed to the user and inability to end user sessions once established with JWT. I have been creating pages in the /pages folder instead of the /app folder and api in the /pages/api folder.
I recently read an article* about properly using Next.js and server actions, which I haven't been using I don't think. I believe I have been using API calls.
I have a few questions and would appreciate input on any of them.
1. Should I revamp from /pages to /app use?
2. Should I upgrade from Next.js 13 to 14?
3. Should I really worry about JWT vs server sessions? JWT seems easier to implement since Auth.js comes set with that in mind.

*https://vercel.com/blog/common-mistakes-with-the-next-js-app-router-and-how-to-fix-them

1 Reply

BurmeseOP
I followed upgrade guidelines from Next.js and the upgrade from next 13 to 14 was simple. It did require upgrading some other things like mongodb and @auth/mongodb-adapter etc but everything "appears" to be working fine.

Will look at attempting to move folder structure from /pages to /app next, though I am not sure what all benefit there is from it.