mirror of
https://github.com/lukevella/rallly.git
synced 2025-04-28 17:56:37 +02:00
🐛 Handle expired jwt
This commit is contained in:
parent
3e4b0f8a3d
commit
61fca3faa7
1 changed files with 9 additions and 4 deletions
|
@ -9,10 +9,15 @@ export async function decodeLegacyJWT(token: string): Promise<JWT | null> {
|
||||||
process.env.SECRET_PASSWORD,
|
process.env.SECRET_PASSWORD,
|
||||||
"",
|
"",
|
||||||
);
|
);
|
||||||
|
try {
|
||||||
const { payload } = await jwtDecrypt(token, encryptionSecret, {
|
const { payload } = await jwtDecrypt(token, encryptionSecret, {
|
||||||
clockTolerance: 15,
|
clockTolerance: 15,
|
||||||
});
|
});
|
||||||
return payload;
|
return payload;
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getDerivedEncryptionKey(
|
async function getDerivedEncryptionKey(
|
||||||
|
|
Loading…
Add table
Reference in a new issue