Skip to content

Commit

Permalink
fix: fix the expired jwt (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivan-s authored Dec 29, 2024
1 parent a3b7990 commit 6222527
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/lib/server/crypto/crypto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { SECRET } from '$env/static/private';
import type { SelectPassword, SelectUser } from '$lib/server/db/schema';
import * as jose from 'jose';
import { JWEInvalid } from 'jose/errors';
import { JWEInvalid, JWTExpired } from 'jose/errors';
import Hash from './hash';
import { v4 as uuid } from 'uuid';

Expand Down Expand Up @@ -65,6 +65,10 @@ export async function decodeJWT(
console.log('JWE invalid');
return null;
}
if (err instanceof JWTExpired) {
console.log('JWT Expired');
return null;
}
throw err;
}
}
Expand Down

0 comments on commit 6222527

Please sign in to comment.