Skip to content

Commit

Permalink
๐Ÿ”จrefactor: ์ด๋ฉ”์ผ ์ธ์ฆ์„œ๋น„์Šค ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
jeong011010 committed Oct 15, 2024
1 parent bd5d322 commit fc9045d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ public class UserService {
@Transactional
public User registerUser(UserRequest userRequest) {
validateUsernameAvailability(userRequest.getUsername());
User savedUser = userRepository.save(userRequest.toEntity(passwordEncoder.encode(userRequest.getPassword())));
return savedUser;

validateEmailAvailability(userRequest.getEmail()); // ์ด๋ฉ”์ผ ์ค‘๋ณต ๊ฒ€์‚ฌ ์ถ”๊ฐ€


// ์‚ฌ์šฉ์ž ์ €์žฅ
User user = userRequest.toEntity(passwordEncoder.encode(userRequest.getPassword()));
User savedUser = userRepository.save(user);

userRepository.save(user);

// ์ด๋ฉ”์ผ ์ธ์ฆ ํ† ํฐ ์ƒ์„ฑ ๋ฐ ์ด๋ฉ”์ผ ๋ฐœ์†ก
String token = generateEmailVerificationToken(user);
String token = generateEmailVerificationToken(savedUser);
emailService.sendVerificationEmail(user.getEmail(), token);
return savedUser;
}

@Transactional(readOnly = true)
Expand Down

0 comments on commit fc9045d

Please sign in to comment.