This is a simple demonstration of using middleware-based JWT verification in NEXT.js. It should work out of the box, without any setup.
The default password and username is hardcoded into /api/auth but in production you would probably match their username to a database and match their password's hash before letting them in. That isn't done here because this app is a demonstration of JWTs and not a fully featured authentication system.
The project root is /nextjsattempt/ and there's another README in there with instructions on running the app. Check it out!
TODO: Convert JS to TS. This project was made before I learnt of TypeScript, So I'd like to convert it when I find time.
I hope this helps you if you were thinking of making a login system in NEXT. 😊