I am writing a user database. Some of my users are admins. In my db every user has their profile marked with a boolean value if they are an admin or not. Authentication is made through passport with a local method checking the login credetials, which returns a JWT token, to be used for further authentication. I heard there is a possibility to extract data from the token. I would like to extract the boolean value from the token if thats possible to check if someone is an admin when accessing certain routes or making certain requests.
Can someone tell me if this is possible and if yes how to do it?
I tried some of the parsing methos included into passport but wasn´t sure how to execute them properly.