Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/handlers/authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export const usePassport = function(app: any, prisma: PrismaClient): void {
cookie: {
maxAge: 1000 * 60 * 60 * 24 * 7, // ms
secure: (NODE_ENV === 'production'), // Secure HTTPS cookies only in production
sameSite: "lax", // Bound the cookie to be sent only from self frontend (reduce exposurse to CSRF)
},
name: 'nl.codam.coalitions.session',
proxy: (NODE_ENV === 'production'), // Trust the X-Forwarded-Proto header
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ const main = async () => {
// Set up the Express app
const app = express();

// Adding size limit to json request (DoS); 10kb seems to be standard
app.use(express.json({ limit: "10kb" }));

// Adding helmet
app.use(helmet.contentSecurityPolicy({
directives: {
Expand Down