Unsure what's causing this, but occurs when handling requests with this module. Confirmed the expected behaviour when using express-brute with MemoryStore().
TypeError: value.lastRequest.getTime is not a function
at .<anonymous> (/home/xxx/node_modules/express-brute/index.js:100:47)
at LokiStore.get (/home/xxx/node_modules/express-brute-loki/lib/express-brute-loki.js:111:3)
at .<anonymous> (/home/xxx/node_modules/express-brute/index.js:82:15)
at keyFunc (/home/xxx/node_modules/express-brute/index.js:39:41)
at .<anonymous> (/home/xxx/node_modules/express-brute/index.js:47:3)
at Layer.handle [as handle_request] (/home/xxx/node_modules/express/lib/router/layer.js:95:5)
at next (/home/xxx/node_modules/express/lib/router/route.js:137:13)
at Route.dispatch (/home/xxx/node_modules/express/lib/router/route.js:112:3)
at Layer.handle [as handle_request] (/home/xxx/node_modules/express/lib/router/layer.js:95:5)
at /home/xxx/node_modules/express/lib/router/index.js:281:22
Code:
var store = new ExpressBruteLokiStore({
path: './brute.db'
});
//var store = new ExpressBrute.MemoryStore(); // stores state locally, don't use this in production
var bruteforce = new ExpressBrute(store);
app.post('/auth',
bruteforce.prevent, // error 429 if we hit this route too often
function (req, res, next) {
res.send('Success!');
}
);
Unsure what's causing this, but occurs when handling requests with this module. Confirmed the expected behaviour when using
express-brute
withMemoryStore()
.Code: