mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-11 07:04:32 +02:00
Resolve TODO RE using EnigError for bad login attempts
This commit is contained in:
parent
ebc70907d4
commit
9fd819d608
5 changed files with 27 additions and 18 deletions
|
@ -10,6 +10,7 @@ const userLogin = require('../../user_login.js').userLogin;
|
|||
const enigVersion = require('../../../package.json').version;
|
||||
const theme = require('../../theme.js');
|
||||
const stringFormat = require('../../string_format.js');
|
||||
const { ErrorReasons } = require('../../enig_error.js');
|
||||
|
||||
// deps
|
||||
const ssh2 = require('ssh2');
|
||||
|
@ -70,7 +71,7 @@ function SSHClient(clientConn) {
|
|||
|
||||
userLogin(self, ctx.username, ctx.password, function authResult(err) {
|
||||
if(err) {
|
||||
if(err.existingConn) {
|
||||
if(ErrorReasons.AlreadyLoggedIn === err.reasonCode) {
|
||||
return alreadyLoggedIn(username);
|
||||
}
|
||||
|
||||
|
@ -96,7 +97,7 @@ function SSHClient(clientConn) {
|
|||
|
||||
userLogin(self, username, (answers[0] || ''), err => {
|
||||
if(err) {
|
||||
if(err.existingConn) {
|
||||
if(ErrorReasons.AlreadyLoggedIn === err.reasonCode) {
|
||||
return alreadyLoggedIn(username);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue