Skip to content

Commit

Permalink
Purge email records after 30 days (openhab#423)
Browse files Browse the repository at this point in the history
Signed-off-by: Dan Cunningham <[email protected]>
  • Loading branch information
digitaldan authored Jan 29, 2023
1 parent adcc9c9 commit 9d2d6db
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion models/emailverification.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var EmailVerificationSchema = new Schema({
email: String,
user: {type: ObjectId, ref: 'User'},
used: {type: Boolean, default: false},
created: { type: Date, default: Date.now }
created: { type: Date, default: Date.now, expires: '30d'}
});

// This is a static method to create and send a new invitation in one shot!
Expand Down
2 changes: 1 addition & 1 deletion models/invitation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var InvitationSchema = new Schema({
email: String,
used: {type: Boolean, default: false},
lastNotified: {type: Date},
created: { type: Date, default: Date.now, expires: '7d' },
created: { type: Date, default: Date.now, expires: '30d' },
activated: { type: Date }
});

Expand Down
2 changes: 1 addition & 1 deletion models/lostpassword.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var LostPasswordSchema = new Schema({
user: ObjectId,
recoveryCode: String,
used: { type: Boolean, default: false },
created: { type: Date, default: Date.now, expires: '1d' }
created: { type: Date, default: Date.now, expires: '30d' }
});

LostPasswordSchema.index({user:1, created:1});
Expand Down

0 comments on commit 9d2d6db

Please sign in to comment.