mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-12 21:52:40 +01:00
Merge remote-tracking branch 'origin/fix/claim_accounts' into slowcord
This commit is contained in:
commit
3ea721b4ba
@ -62,14 +62,14 @@ router.patch("/", route({ body: "UserModifySchema" }), async (req: Request, res:
|
||||
user.data.hash = await bcrypt.hash(body.new_password, 12);
|
||||
}
|
||||
|
||||
if(body.username){
|
||||
var check_username = body?.username?.replace(/\s/g, '');
|
||||
if(!check_username) {
|
||||
throw FieldErrors({
|
||||
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
|
||||
});
|
||||
}
|
||||
}
|
||||
if (body.username) {
|
||||
var check_username = body?.username?.replace(/\s/g, '');
|
||||
if (!check_username) {
|
||||
throw FieldErrors({
|
||||
username: { code: "BASE_TYPE_REQUIRED", message: req.t("common:field.BASE_TYPE_REQUIRED") }
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
user.assign(body);
|
||||
await user.save();
|
||||
|
Loading…
Reference in New Issue
Block a user