express-brute icon indicating copy to clipboard operation
express-brute copied to clipboard

Add custom properties to stored object

Open origooo opened this issue 4 years ago • 0 comments

Thanks for a great package!

I was wondering if there is a way for adding custom properties to the object which eventually is stored in whatever persistent storage one has picked?

My use case is that if a user hits their upper limit on an endpoint and later contact our support it's a bit challenging to figure out what entry in e.g. express-brute-mongoose belongs to them. I would like to be able to add for example a user id or email.

Is there a way to do this already, or am I thinking about it wrong?

From what I can see in row 127 in index.js (version 1.0.1) it is only looking at the predefined properties;

this.store.set(key, {
	count: count+1,
	lastRequest: new Date(this.now()),
	firstRequest: new Date(firstRequestTime)
}, ...)

origooo avatar Jul 05 '21 13:07 origooo