Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

refactor: create middleware specitif file for errorHandling, sessions… #2342

Merged
merged 1 commit into from
Jan 16, 2024

Conversation

LucasCharrier
Copy link
Collaborator

…, cors

src/middlewares/sessionMiddleware.ts Dismissed Show dismissed Hide dismissed
Comment on lines +7 to +21
session({
store: process.env.NODE_ENV !== 'test' ? makeSessionStore() : null,
secret: config.secret,
resave: false, // required: force lightweight session keep alive (touch)
saveUninitialized: false, // recommended: only save session when data exists
unset: 'destroy',
proxy: true, // Required for Heroku & Digital Ocean (regarding X-Forwarded-For)
name: 'espaceMembreCookieName',
cookie: {
maxAge: 24 * 60 * 60 * 1000 * 7,
httpOnly: true,
secure: process.env.NODE_ENV === 'production' ? true : false,
sameSite: 'lax',
},
})

Check warning

Code scanning / CodeQL

Clear text transmission of sensitive cookie Medium

Sensitive cookie sent without enforcing SSL encryption.
@LucasCharrier LucasCharrier merged commit 77bf617 into master Jan 16, 2024
5 checks passed
@LucasCharrier LucasCharrier deleted the task/refactor-index branch January 16, 2024 09:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant