silvie
Version:
Typescript Back-end Framework
28 lines (27 loc) • 648 B
TypeScript
import BlackList from "./blacklist";
import IAuthDriver from "../..";
type JWTConfig = {
secret: string;
blacklist: string;
};
export default class JWTDriver implements IAuthDriver {
blacklist: BlackList;
config: JWTConfig;
constructor(config: JWTConfig);
/**
* Generate a JWT token from the given payload
* @param payload
*/
generate(payload: any): string;
/**
* Validates a given token and returns the payload
* @param token
*/
validate(token: string): any;
/**
* Invalidates a given token
* @param token
*/
invalidate(token: string): boolean;
}
export {};