method IJwtService.decode
IJwtService.decode<T = Readonly<Record<string, unknown>>>(token: string): T | null

Decodes a token without verifying it. Never trust the result for authorization decisions.

Type Parameters

T = Readonly<Record<string, unknown>>

The expected payload shape

Parameters

token: string

The token to decode

Return Type

T | null

The decoded payload, or null when malformed

Usage

import { type IJwtService } from "auth-plugin/src/index.ts";