D
D
Denis11112018-08-31 19:43:31
Node.js
Denis1111, 2018-08-31 19:43:31

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

2 answer(s)
D
Dimonchik, 2018-08-31
@dimonchik2013

access deny all

K
Kirill Kudryavtsev, 2018-09-01
@Deissh

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 question

Ask a Question

731 491 924 answers to any question