mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
26 lines
429 B
TypeScript
26 lines
429 B
TypeScript
|
export class InvalidTokenError extends Error {}
|
||
|
|
||
|
export interface JwtDecodeOptions {
|
||
|
header?: boolean;
|
||
|
}
|
||
|
|
||
|
export interface JwtHeader {
|
||
|
type?: string;
|
||
|
alg?: string;
|
||
|
}
|
||
|
|
||
|
export interface JwtPayload {
|
||
|
iss?: string;
|
||
|
sub?: string;
|
||
|
aud?: string[] | string;
|
||
|
exp?: number;
|
||
|
nbf?: number;
|
||
|
iat?: number;
|
||
|
jti?: string;
|
||
|
}
|
||
|
|
||
|
export default function jwtDecode<T = unknown>(
|
||
|
token: string,
|
||
|
options?: JwtDecodeOptions
|
||
|
): T;
|