jose
Version:
JWA, JWS, JWE, JWT, JWK, JWKS for Node.js, Browser, Cloudflare Workers, Deno, Bun, and other Web-interoperable runtimes
20 lines (19 loc) • 1.01 kB
TypeScript
import type * as t from '../types.d.ts';
/** Decoded Unsecured JWT. */
export interface UnsecuredResult<PayloadType = t.JWTPayload> {
/** JWT Claims Set. */
payload: PayloadType & t.JWTPayload & ([PayloadType] extends [object] ? unknown : unknown extends PayloadType ? unknown : never);
/** The decoded JOSE Header; its "alg" (Algorithm) Header Parameter is "none". */
header: t.JWSHeaderParameters;
}
/** @param payload Initial JWT Claims Set. Defaults to an empty object. */
declare const UnsecuredJWT_base: new (payload?: t.JWTPayload) => t.ProduceJWT;
/** Encodes and decodes `{ "alg": "none" }` Unsecured JWTs. */
export declare class UnsecuredJWT extends UnsecuredJWT_base {
private jwt;
/** Encodes the Unsecured JWT. */
encode(): string;
/** Decodes an unsecured JWT and validates its claims without authenticating the token. */
static decode<PayloadType = t.JWTPayload>(jwt: string, options?: t.JWTClaimVerificationOptions): UnsecuredResult<PayloadType>;
}
export {};