alapa
Version:
A cutting-edge web development framework designed to revolutionize the way developers build modern web applications.
28 lines (27 loc) • 777 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.JWT = void 0;
const jose_1 = require("./jose");
class JWT {
static error;
static jwt = new jose_1.JoseJWT("hello world");
static getConfig() { }
static async generateToken(payload) {
const jwt = await this.jwt.generateToken(payload);
return {
success: true,
token: jwt.token,
expiresAt: jwt.expiresAt,
isoDate: jwt.expiresAt.toISOString(),
};
}
static async verifyToken(token) {
const result = await this.jwt.verifyToken(token);
if (result === false) {
this.error = this.jwt.error;
return false;
}
return result;
}
}
exports.JWT = JWT;
;