Comment by baobun

19 hours ago

You should look deeper into JWTs and what you can do with them. Sounds like you are on the way to reinventing them.

Yes! This is exactly what we're doing now which also helps us be a little more framework agnostic. Nextjs kind of just lets us have them built-in

  • JWT is a standard that is supported by a lot of frameworks and auth libraries. It’s also reasonably straightforward to implement yourself. It’s very easy to make big security mistakes when you roll your own security, though, so it’s best to at least stick with proven paradigms even if you implement it yourself for a new framework. Also read up on the mistakes people have made in implementing it and avoid repeating those mistakes.