component-dbs-core
Version:
DTO objects shared among device backend
39 lines (38 loc) • 886 B
TypeScript
import JwtLib from './jwtLib';
export declare const JWT_ERROR: {
INVALID_ISSUER: string;
SIGNING_KEY_NOT_FOUND: string;
TOKEN_EXPIRED: string;
MALFORMED_TOKEN: string;
};
export declare const JWT_CHECK_RESULT: {
ERROR_INVALID_ISSUER: {
code: number;
errorMessage: string;
};
ERROR_TOKEN_EXPIRED: {
code: number;
errorMessage: string;
};
ERROR_MALFORMED_TOKEN: {
code: number;
errorMessage: string;
};
ERROR_UNHANDLED: {
code: number;
errorMessage: string;
};
VALID_TOKEN: {
code: number;
errorMessage: string;
};
};
export default class JwtValidator {
private readonly jwtLib;
constructor(jwtLib: JwtLib);
private getJWTError;
validate: (accessToken: string) => Promise<{
code: number;
errorMessage: string;
}>;
}