Skip to content

Commit

Permalink
decode iat
Browse files Browse the repository at this point in the history
  • Loading branch information
mluena committed Oct 18, 2024
1 parent c57783b commit 4731dd6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/src/app/api/auth/[...nextauth]/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ export const authOptions: AuthOptions = {

if (sessionToken) {
const now = new Date().getTime();
const exp = decoded.iat ? decoded.iat * 1000 + SESSION_MAX_AGE * 1000 : 0;
const exp = decoded.iat
? decoded.iat * 1000 + SESSION_MAX_AGE * 1000
: SESSION_MAX_AGE * 1000;

if (now < exp) {
return {
Expand Down

0 comments on commit 4731dd6

Please sign in to comment.