Replaced Express-Brute store from Mongo to Mongoose

This commit is contained in:
NGPixel
2016-10-17 19:22:28 -04:00
parent 94fe4bbf14
commit 2cf8f2c247
4 changed files with 23 additions and 8 deletions

20
models/bruteforce.js Normal file
View File

@@ -0,0 +1,20 @@
"use strict";
const modb = require('mongoose');
/**
* BruteForce schema
*
* @type {<Mongoose.Schema>}
*/
var bruteForceSchema = modb.Schema({
_id: { type: String, index: 1 },
data: {
count: Number,
lastRequest: Date,
firstRequest: Date
},
expires: { type: Date, index: { expires: '1d' } }
});
module.exports = modb.model('Bruteforce', bruteForceSchema);