Is it a good idea to call a server in the guard in order to verify if jwt is valid?
I'm storing jwt on the frontend, but I don't know if that token is expired or blacklisted unless I contact the backend. Also, I don't know the user's role, which is important to me for AdminGuard.
The first idea I have had is just to simply call the backend, and with that approach, I'll have all the necessary information, but the main concern of that approach is that every time route is changed, I'll need http call.
After some digging, I found a library for angular, to verify jwt. And about roles, I could just save the user's role as a payload, and then decode it with this jwt library. The blacklisted tokens might be a problem, but I think that is a rare scenario, and even if the guard lets that user continues on a certain route, my server will just return an error on the first request and I'll redirect.
Should I try the second approach? Or http calls is not a big deal in guards?