Skip to content

Commit

Permalink
fix(auth): session expiration time unit
Browse files Browse the repository at this point in the history
  • Loading branch information
BlairCurrey committed Aug 6, 2024
1 parent b1f9248 commit 2e309f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/auth/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ export class App {
},
async set(key, session) {
// Add a delay to cookie age to ensure redis record expires after cookie
const expireInMs = maxAgeMs + 10 * 1000
const expireInSec = maxAgeMs / 1000 + 10
const op = redis.multi()
op.set(key, JSON.stringify(session))
op.expire(key, expireInMs)
op.expire(key, expireInSec)
await op.exec()
},
async destroy(key) {
Expand Down

0 comments on commit 2e309f9

Please sign in to comment.