Skip to content

Commit

Permalink
fix(session-middleware): don't hardcode database ttl
Browse files Browse the repository at this point in the history
The cookie expiration is taken from the config,
but the expiration of session data in the database was hardcoded.

This removes the hardcoded value, so TypeormStore defaults
to cookie.maxAge.

References:
https://github.com/nykula/connect-typeorm#options
https://github.com/expressjs/session#cookiemaxage
Signed-off-by: David Mehren <[email protected]>
  • Loading branch information
davidmehren committed Feb 27, 2022
1 parent cf5c398 commit 931a168
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/utils/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ export function setupSessionMiddleware(
saveUninitialized: false,
store: new TypeormStore({
cleanupLimit: 2,
ttl: 86400,
}).connect(app.get<Repository<Session>>(getRepositoryToken(Session))),
}),
);
Expand Down

0 comments on commit 931a168

Please sign in to comment.