Library API
    Preparing search index...

    Function decodeJWTPayload

    • Decodes a JWT payload without verifying its signature.

      Type Parameters

      • T = unknown

      Parameters

      • token: string

        The JWT string to decode

      Returns T

      The parsed JSON payload of the JWT

      WARNING: This function does NOT perform signature verification. It strictly decodes the payload for inspection. To ensure the integrity and authenticity of the token, you MUST verify the signature using a trusted library (e.g., jsonwebtoken) and your secret/public key.

      If the token is malformed or the payload cannot be parsed

      const payload = decodeJWTPayload`<MyPayloadType>`(token);