I am trying to generate a JWT token which I will do in my Laravel project like this solution I found: https://github.com/luciferous/jwt/blob/master/JWT.php
So I have 2 questions I am trying to get wrap my head around:
In my Next.js React project, i would set the JWT in a cookie to remember it. Is that right? And then can pass it with every request to the server to verify the user.
How could I decode it then in Next.js? So that I could get some basic info out of it like a username.