UNPKG

silvie

Version:

Typescript Back-end Framework

25 lines (24 loc) 580 B
import IAuthDriver from "./driver"; declare class Auth { static driver: IAuthDriver; token: string; payload: any; user: any; constructor(payload: any, token: string, user?: any); static init(): void; /** * Generates a token for the given payload * @param payload */ static login(payload: any): Auth; /** * Checks a token to see if it is valid or not * @param token */ static check(token: string): Auth; /** * Invalidates the current auth instance */ logout(): boolean; } export default Auth;