feat: app.use session store
This commit is contained in:
@@ -57,6 +57,19 @@ const sessionStore = new PgSession({
|
|||||||
},
|
},
|
||||||
} as PgStoreOptions);
|
} as PgStoreOptions);
|
||||||
|
|
||||||
|
app.use(
|
||||||
|
session({
|
||||||
|
store: sessionStore,
|
||||||
|
secret: 'mx-session',
|
||||||
|
resave: false,
|
||||||
|
saveUninitialized: false,
|
||||||
|
cookie: {
|
||||||
|
secure: process.env.NODE_ENV === 'production',
|
||||||
|
maxAge: 24 * 60 * 60 * 1000,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const server = http.createServer(app);
|
const server = http.createServer(app);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user