UNPKG

lbx-jwt

Version:

Provides JWT authentication for loopback applications. Includes storing roles inside tokens and handling refreshing. Built-in reuse detection.

27 lines (26 loc) 490 B
/** * A Json Web Token, containing the token itself and its expiration date. */ export declare class Jwt { /** * The token value. */ value: string; /** * The timestamp at which the token is no longer valid. */ expirationDate: Date; } /** * The payload of a jwt. */ export interface JwtPayload<RoleType extends string> { /** * The id of the user. */ id: string; /** * The roles of the user. */ roles: RoleType[]; }