aaa
This commit is contained in:
parent
fbadd95c4f
commit
5ec2c33a5b
@ -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'));
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user