15 lines
642 B
TypeScript
15 lines
642 B
TypeScript
import jwt from 'jsonwebtoken';
|
|
export type ActorType = 'admin' | 'employee' | 'renter';
|
|
export type ActorTokenPayload = jwt.JwtPayload & {
|
|
sub: string;
|
|
type: ActorType;
|
|
sessionVersion?: number;
|
|
last2faAt?: number;
|
|
};
|
|
export declare function signActorToken(actorId: string, actorType: ActorType, options?: Pick<jwt.SignOptions, 'expiresIn'> & {
|
|
sessionVersion?: number;
|
|
last2faAt?: number;
|
|
}): string;
|
|
export declare function verifyActorToken(token: string, expectedType: ActorType): ActorTokenPayload;
|
|
export declare function verifyAnyActorToken(token: string): ActorTokenPayload;
|
|
//# sourceMappingURL=tokens.d.ts.map
|