mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-10 06:34:41 +02:00
Logging around accoung lock/unlocking
This commit is contained in:
parent
f0e7b46a2f
commit
a4823c0c4a
3 changed files with 11 additions and 3 deletions
|
@ -24,14 +24,13 @@ function userLogin(client, username, password, cb) {
|
|||
const config = Config();
|
||||
|
||||
if(err) {
|
||||
client.log.info( { username : username, error : err.message }, 'Failed login attempt');
|
||||
|
||||
client.user.sessionFailedLoginAttempts = _.get(client.user, 'sessionFailedLoginAttempts', 0) + 1;
|
||||
const disconnect = config.users.failedLogin.disconnect;
|
||||
if(disconnect > 0 && client.user.sessionFailedLoginAttempts >= disconnect) {
|
||||
return cb(Errors.BadLogin('To many failed login attempts', ErrorReasons.TooMany));
|
||||
err = Errors.BadLogin('To many failed login attempts', ErrorReasons.TooMany);
|
||||
}
|
||||
|
||||
client.log.info( { username : username, error : err.message }, 'Failed login attempt');
|
||||
return cb(err);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue