require expiration on auth tokens

This commit is contained in:
2026-09-06 17:52:34 +03:00
parent 304682a07f
commit 2cac68e6ba
+1 -1
View File
@@ -54,7 +54,7 @@ export function verifyToken(token) {
}
try {
const body = JSON.parse(Buffer.from(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString());
if (body.exp && body.exp < Math.floor(Date.now() / 1000)) return null;
if (!Number.isSafeInteger(body.exp) || body.exp <= Math.floor(Date.now() / 1000)) return null;
return body;
} catch {
return null;