diff --git a/BE/src/auth/users.repository.ts b/BE/src/auth/users.repository.ts index c5bf786..e77c642 100644 --- a/BE/src/auth/users.repository.ts +++ b/BE/src/auth/users.repository.ts @@ -13,6 +13,17 @@ export class UsersRepository { const salt = await bcrypt.genSalt(); const hashedPassword = await bcrypt.hash(password, salt); + + const userIdDuplicate = await User.findOne({ where: { userId: userId } }); + if (userIdDuplicate) { + throw new ConflictException("중복된 아이디입니다."); + } + + const emailDuplicate = await User.findOne({ where: { email: email } }); + if (emailDuplicate) { + throw new ConflictException("중복된 이메일입니다."); + } + const user = User.create({ userId, password: hashedPassword,