Never trust the token about itself
The token is attacker-controlled, so nothing in it — least of all how to verify it — can be trusted:
Tip: Pin the accepted algorithm in your verification call (never read it from the token), and reject
noneoutright. Use a long random secret for HMAC or proper keys for RSA/ECDSA, verifyexp/nbf/aud, and keep anything truly sensitive server-side rather than trusting claims in a token.