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) => {
|
const checkManaged: RequestHandler = (req, res, next) => {
|
||||||
if (!req.body.name || !req.body.password) {
|
if (!req.body.name || !req.body.password) {
|
||||||
return next(new Error('missing_fields'));
|
return next(new Error('Missing name or password'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find user account
|
// Find user account
|
||||||
const findUser = managed.getAccount(req.body.name);
|
const findUser = managed.getAccount(req.body.name);
|
||||||
if (!findUser) {
|
if (!findUser) {
|
||||||
return next(new Error('invalid'));
|
return next(new Error('Invalid name or password'));
|
||||||
}
|
}
|
||||||
console.log(findUser);
|
|
||||||
|
|
||||||
// Validate password
|
// Validate password
|
||||||
managed.validatePassword(findUser, req.body.password).then((success) => {
|
managed.validatePassword(findUser, req.body.password).then((success) => {
|
||||||
@ -556,7 +555,7 @@ const checkManaged: RequestHandler = (req, res, next) => {
|
|||||||
return next();
|
return next();
|
||||||
}
|
}
|
||||||
|
|
||||||
next(new Error('invalid'));
|
next(new Error('Invalid name or password'));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user