require expiration on auth tokens
This commit is contained in:
+1
-1
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user