I need to create create a row in my database conditionally. So, I have a session without creating a new row and then I need to somehow add store: new pgSession({...}) to my existing session. How can I achieve this?
const app = express();
const pg = require('pg');
const session = require('express-session');
const pgSession = require('connect-pg-simple')(session);
app.use(session({
... // I don't have store: new pgSession({...}) to connect to postgres database
genid: req => {return uuidv4()}
})
^^ How can I add new pgSession({...}) to my session later on?
i.e. can I do something like res.session.store = new pgSession({...}) ?