In the backend of my app I set up the discord oAuth and I can check if the user exist/register new user after they authorize with discord.
I also generate a token using j