Skip to content

Commit 255718d

Browse files
committed
debug
1 parent f9b9dc7 commit 255718d

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/controller/user.controller.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,10 @@ async function register(req, res) {
2121
user_name: user_name
2222
};
2323
const user = await User.findUser(contrain);
24-
// let pass = /^(?=.*\d)(?=.*[!@#$%_^&*])(?=.*[a-zA-Z]).{8,}$/;
25-
// if (!pass.test(password)) {
26-
// return res.json(response.fail("Mật khẩu bao gồm ít nhất 8 kí tự, trong đó chứa ít nhất 1 chữ, 1 số và 1 kí tự đặc biệt"));
27-
// }
2824
if(password.length < 8){
2925
throw new Error("Mật khẩu phải có ít nhất 8 kí tự.");
3026
}
27+
console.log("oki");
3128
if (user == null) {
3229
let salt = await bcrypt.genSalt(10);
3330
let hashPassword = await bcrypt.hash(password, salt);
@@ -41,6 +38,7 @@ async function register(req, res) {
4138
avatar: "/img/avatar.png"
4239
};
4340
const newUsers = await User.createUser(payload);
41+
console.log(newUsers);
4442
return res.json(response.success({}));
4543
}
4644
else{

0 commit comments

Comments
 (0)