diff --git a/user/src/main/java/com/weather/user/service/UserServiceImpl.java b/user/src/main/java/com/weather/user/service/UserServiceImpl.java index 5d13942..fdb0938 100644 --- a/user/src/main/java/com/weather/user/service/UserServiceImpl.java +++ b/user/src/main/java/com/weather/user/service/UserServiceImpl.java @@ -50,6 +50,12 @@ public void signup(UserDTO userDTO) { throw new Error("이미 존재하는 이메일입니다."); } + optionalUser = userRepository.findByNickname(userDTO.getNickname()); + + if(optionalUser.isPresent()) { + throw new Error("이미 존재하는 닉네임입니다."); + } + userDTO.setPassword(passwordEncoder.encode(userDTO.getPassword())); userDTO.setStatus(true); User user = dtoToEntity(userDTO);