I am building authentication with:
- Backend: Django (DRF) + Djoser for JWT authentication.
- Frontend: Next.js using Auth.js (NextAuth) for authentication.
I want users to log in via Next.js, authenticate with Djoser’s jwt/create/, and store/manage tokens properly. However, the Auth.js docs are unclear, and I’m struggling with:
- Handling JWT token storage and refreshing in NextAuth.js.
- Making authenticated API requests from the frontend.
- Implementing logout properly.