The algorithm is pinned to HS256: any other alg, including none, is
rejected. The token must carry a numeric exp claim; nbf is checked
when present, and iss / aud when options require them.
This is a minimal JWT verifier intended for middleware use cases. For
production systems requiring RS256/ES256 or full JOSE support, consider
using a dedicated JWT library.
Parameters
jwtSecret: string
The HMAC secret (UTF-8 string or hex-encoded key).
Verify a JWT (HS256 only) using HMAC-SHA256.
The algorithm is pinned to HS256: any other
alg, includingnone, is rejected. The token must carry a numericexpclaim;nbfis checked when present, andiss/audwhenoptionsrequire them.This is a minimal JWT verifier intended for middleware use cases. For production systems requiring RS256/ES256 or full JOSE support, consider using a dedicated JWT library.