Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

value.lastRequest.getTime is not a function #5

Open
sudosammy opened this issue Jan 22, 2018 · 1 comment
Open

value.lastRequest.getTime is not a function #5

sudosammy opened this issue Jan 22, 2018 · 1 comment

Comments

@sudosammy
Copy link

sudosammy commented Jan 22, 2018

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!');
    }
);
@cmsiesde
Copy link

I have the same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants