This commit is contained in:
2026-08-14 16:03:47 +01:00
parent fd53e3f4fb
commit dfdc3b2840
2463 changed files with 186456 additions and 111315 deletions
+12 -7
View File
@@ -1,4 +1,3 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
@@ -82,14 +81,20 @@ const verify = async (token, publicKey, algOrOptions) => {
throw new import_types.JwtAlgorithmMismatch(alg, header.alg);
}
const now = Math.floor(Date.now() / 1e3);
if (nbf && payload.nbf && payload.nbf > now) {
throw new import_types.JwtTokenNotBefore(token);
if (nbf && payload.nbf !== void 0) {
if (typeof payload.nbf !== "number" || !Number.isFinite(payload.nbf) || payload.nbf > now) {
throw new import_types.JwtTokenNotBefore(token);
}
}
if (exp && payload.exp && payload.exp <= now) {
throw new import_types.JwtTokenExpired(token);
if (exp && payload.exp !== void 0) {
if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp) || payload.exp <= now) {
throw new import_types.JwtTokenExpired(token);
}
}
if (iat && payload.iat && now < payload.iat) {
throw new import_types.JwtTokenIssuedAt(now, payload.iat);
if (iat && payload.iat !== void 0) {
if (typeof payload.iat !== "number" || !Number.isFinite(payload.iat) || now < payload.iat) {
throw new import_types.JwtTokenIssuedAt(now, payload.iat);
}
}
if (iss) {
if (!payload.iss) {