UNPKG

dff-util

Version:

DesignForFeature Utilities

28 lines (27 loc) 694 B
/** * Encode JWT Token with secret key, expiresIn in seconds (86400 = 1 day) default * @param data * @param secret * @param expiresIn * @returns */ export declare const JwtEncode: (data: any, secret: string, expiresIn?: number) => string; /** * Verify JWT token with secret * @param token * @param secret * @returns */ export declare const JwtVerify: (token: string, secret: string) => any; /** * Decode JWT Token without verification * @param token * @returns */ export declare const JwtDecode: (token: string) => import("jwt-decode").JwtPayload; /** * Check if token is expired or not * @param token * @returns */ export declare const JwtValid: (token: string) => boolean;