truly fixed registration
This commit is contained in:
@@ -20,7 +20,7 @@ const usernameDoesntExist = async (req, res, next) => {
|
||||
let { username } = req.body;
|
||||
|
||||
let user = await UserService.getByUsername(username);
|
||||
if (user != statuses.not_found) return res.status(400).send("Such username already taken");
|
||||
if (user != undefined && user != statuses.not_found) return res.status(400).send("Such username already taken");
|
||||
next();
|
||||
} catch (e) { return res.status(500).send(log.unknownError(`${TAG}/usernameDoesntExist: ${e}`)); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user