UNPKG

isa-auth-core

Version:
18 lines (17 loc) 593 B
import { SignOptions, VerifyOptions, JwtPayload } from 'jsonwebtoken'; export interface JwtManagerOptions { secret: string; signOptions?: SignOptions; verifyOptions?: VerifyOptions; } export declare class JwtManager { private secret; private signOptions?; private verifyOptions?; constructor(options: JwtManagerOptions); sign(payload: string | Buffer | object, options?: SignOptions): string; verify<T extends object = JwtPayload>(token: string, options?: VerifyOptions): T; decode(token: string): null | { [key: string]: any; } | string; }