fix(session-storage): add typing and trust proxy setting (#9725)

Added explicit typing for session storage options to improve type
safety. Enabled 'trust proxy' to ensure proper client IP and protocol
detection behind proxies. These changes improve security and reliability
in session handling.
This commit is contained in:
Antoine Moreaux
2025-01-20 11:05:34 +01:00
committed by GitHub
parent 7ed2c12e7a
commit 2c8954a44d
2 changed files with 4 additions and 4 deletions

View File

@ -14,10 +14,11 @@ export const getSessionStorageOptions = (
const SERVER_URL = environmentService.get('SERVER_URL');
const sessionStorage = {
const sessionStorage: session.SessionOptions = {
secret: environmentService.get('SESSION_STORE_SECRET'),
resave: false,
saveUninitialized: false,
proxy: true,
cookie: {
secure: !!(SERVER_URL && SERVER_URL.startsWith('https')),
maxAge: 1000 * 60 * 30, // 30 minutes