How to use JWT in Next.js and Rails

Photo by Mathieu Stern on Unsplash

Next.js has several methods to provide authentication. Being that it is one of the main players in the JAMstack game, it can do this without a traditional backend as well. But if are coming with your own backend, be it in Express, Django, or in this example Rails, Next.js can handle that too. JSON Web Tokens are a viable and secure option.

What is JSON Web Tokens?