🐛 Handle expired jwt

This commit is contained in:
Luke Vella 2025-03-07 22:10:36 +00:00
parent 3e4b0f8a3d
commit 61fca3faa7
No known key found for this signature in database
GPG key ID: 469CAD687F0D784C

View file

@ -9,10 +9,15 @@ export async function decodeLegacyJWT(token: string): Promise<JWT | null> {
process.env.SECRET_PASSWORD,
"",
);
try {
const { payload } = await jwtDecrypt(token, encryptionSecret, {
clockTolerance: 15,
});
return payload;
} catch (e) {
console.error(e);
return null;
}
}
async function getDerivedEncryptionKey(