Browse Source

accept some tests, revert secure cookie. limit log

master
Rich Brown 11 months ago
parent
commit
c7c5252cd8
1 changed files with 5 additions and 5 deletions
  1. +5
    -5
      src/index.js

+ 5
- 5
src/index.js View File

@@ -29,20 +29,20 @@ store.on('error', (error) => {
console.log('store error:', error);
});

app.set('trust proxy', 3); // trust first proxy // TODO: test 3 instead of 1
app.set('trust proxy', 1); // trust first proxy

const routesArray = ['/create', '/auth'];

app.use(routesArray, session({
secret: process.env.MONGO_PASSWORD, // dumb
store,
resave: false, // TODO: testing
saveUninitialized: false, // seems okay
cookie: { secure: true, maxAge: 1000 * 60 * 60 * 3, sameSite: false }, // TODO: testing true
resave: false,
saveUninitialized: false,
cookie: { secure: false, maxAge: 1000 * 60 * 60 * 3, sameSite: false },
}));

app.use((req, res, next) => {
console.log(req.session, '<- session string');
console.log(req.session.cookie.expires);
next();
});



Loading…
Cancel
Save