Skip to content

Commit

Permalink
Update expires
Browse files Browse the repository at this point in the history
  • Loading branch information
lukevella committed Feb 13, 2025
1 parent 6a8b33a commit 4c052db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/auth/legacy/next-auth-cookie-migration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export async function getLegacySession(): Promise<Session | null> {
const { sub: id, ...rest } = decodedCookie;
return {
user: { id, ...rest },
expires: new Date(decodedCookie.exp ?? 0).toISOString(),
expires: decodedCookie.exp
? new Date(decodedCookie.exp * 1000).toISOString()
: new Date(Date.now() + 30 * 60 * 60 * 1000).toISOString(),
};
}
}
Expand Down

0 comments on commit 4c052db

Please sign in to comment.