Hello,
I’m encountering an issue with the next-auth middleware. I’m using next-auth v4 within a Next.js app (frontend), and for the backend (authentication and authorization), I’m utilizing Node.js to generate a JWT token (which requires an email and password).
The problem arises in accessing my JWT and decrypted token data within the middleware. Since the middleware isn’t a page or component (*.tsx…), I can’t utilize functions like useSession or getServerSession
on either the server-side or the client-side.
Is there anyone who can assist me with this? Thanks in advance.
Note: Within the token, I have a list of roles, and each role has a list of permissions.
Best regards,