Compare commits
2 Commits
ff55932d44
...
6feab9ef68
Author | SHA1 | Date |
---|---|---|
Ruben Meyer | 6feab9ef68 | |
Ruben Meyer | b7a7b95972 |
|
@ -86,7 +86,7 @@ models.authCode = new Schema({
|
||||||
applicationId: Schema.Types.ObjectId, // reference to application
|
applicationId: Schema.Types.ObjectId, // reference to application
|
||||||
userId: Schema.Types.ObjectId, // reference to user
|
userId: Schema.Types.ObjectId, // reference to user
|
||||||
token: String, // generated token, only usable in combination with userId and applicationId
|
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) => {
|
module.exports = (con) => {
|
||||||
|
|
|
@ -33,7 +33,8 @@ methods.connect = async () => {
|
||||||
mongoose.connect(cfg.mongoose.uri, {
|
mongoose.connect(cfg.mongoose.uri, {
|
||||||
useNewUrlParser: true,
|
useNewUrlParser: true,
|
||||||
useUnifiedTopology: true,
|
useUnifiedTopology: true,
|
||||||
useFindAndModify: false
|
useFindAndModify: false,
|
||||||
|
useCreateIndex: true
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ methods.start = () => {
|
||||||
// Sessions
|
// Sessions
|
||||||
session_options = {
|
session_options = {
|
||||||
secret: cfg.web.sessionKey,
|
secret: cfg.web.sessionKey,
|
||||||
resave: false,
|
resave: true,
|
||||||
saveUninitialized: false,
|
saveUninitialized: false,
|
||||||
cookie: {
|
cookie: {
|
||||||
maxAge: cfg.web.cookieMaxAge
|
maxAge: cfg.web.cookieMaxAge
|
||||||
|
|
Loading…
Reference in New Issue