1
0

Compare commits

..

2 Commits

Author SHA1 Message Date
6feab9ef68
db - fix deprecation warnings and index timestamps 2020-10-30 23:19:48 +01:00
b7a7b95972
web - fix session expiration 2020-10-30 23:18:05 +01:00
3 changed files with 4 additions and 3 deletions

View File

@ -86,7 +86,7 @@ models.authCode = new Schema({
applicationId: Schema.Types.ObjectId, // reference to application
userId: Schema.Types.ObjectId, // reference to user
token: String, // generated token, only usable in combination with userId and applicationId
timestamp: { type: Date, default: Date.now }
timestamp: { type: Date, default: Date.now, index: {unique: true, expires: '5m'} }
});
module.exports = (con) => {

View File

@ -33,7 +33,8 @@ methods.connect = async () => {
mongoose.connect(cfg.mongoose.uri, {
useNewUrlParser: true,
useUnifiedTopology: true,
useFindAndModify: false
useFindAndModify: false,
useCreateIndex: true
});

View File

@ -82,7 +82,7 @@ methods.start = () => {
// Sessions
session_options = {
secret: cfg.web.sessionKey,
resave: false,
resave: true,
saveUninitialized: false,
cookie: {
maxAge: cfg.web.cookieMaxAge