From 5ec2c33a5b07f80b3cd04baf738ce79fbb54acee Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Sat, 26 Feb 2022 14:25:02 +0200 Subject: [PATCH] aaa --- src/index.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index bd2d8e2..5a73ce3 100644 --- a/src/index.ts +++ b/src/index.ts @@ -539,15 +539,14 @@ api.post('/set-ip/:domain', domainAuthorization, async (req, res) => { const checkManaged: RequestHandler = (req, res, next) => { if (!req.body.name || !req.body.password) { - return next(new Error('missing_fields')); + return next(new Error('Missing name or password')); } // Find user account const findUser = managed.getAccount(req.body.name); if (!findUser) { - return next(new Error('invalid')); + return next(new Error('Invalid name or password')); } - console.log(findUser); // Validate password managed.validatePassword(findUser, req.body.password).then((success) => { @@ -556,7 +555,7 @@ const checkManaged: RequestHandler = (req, res, next) => { return next(); } - next(new Error('invalid')); + next(new Error('Invalid name or password')); }); }