Answer the question
In order to leave comments, you need to log in
How to block a user by ip?
How to make it so that when a user tries to log in to his account 3 times (trying to pick up a password), the server will block him by IP for several days. It is not necessary to write code. Just what check and put and what to do
Answer the question
In order to leave comments, you need to log in
As an option, for example, you can save the in-Memory database of the ip of the user from whom the request came, since you will need to check each connection.
Since you are writing on express, you will most likely be / use NGINX, it will be more efficient to use a proper blacklist in it.
# /usr/local/nginx/conf/some.conf
include blacklist.conf;
# /usr/local/nginx/conf/blacklist.conf
location / {
# ip's
deny 8.8.8.8;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question