Next.js Discord

Discord Forum

Using a Custom JWT Backend

Unanswered
Small Münsterländer posted this in #help-forum
Open in Discord
Small MünsterländerOP
Hello,

I'm writing a Next.js application that is mainly just UI for my Django backend. The Django backend uses an implementation of JWT with login, refresh and sign-up actions.

I have been wondering what is the best practice of doing user authentication in my project? I have heard about NextAuth.js but it does seem to be an overkill for my project. Do you suggest using NextAuth.js and can you perhaps share some open-source examples?

I wrote a simple authentication system with iron-session but sometimes I get a weird error after running npm run dev or hot reload. The error says I can't update session in client components but I have to assume that my Profile page is a server component. Am I wrong?

Here's the source code of the project: https://github.com/Winter-Seminar-Series/WSS-site/

Thank you!

0 Replies