패스워드 초기화시 잠금 해제 되도록 변경

This commit is contained in:
Rinjae
2025-11-21 12:06:16 +09:00
parent 6cf4a744f8
commit e023d4828c
2 changed files with 5 additions and 2 deletions
@@ -119,7 +119,7 @@ public class AccountRecoveryController {
try {
// 사용자 정보 확인
portalUserAuthService.initializePassword(
portalUserAuthService.resetPassword(
passwordReset.getLoginId(),
passwordReset.getUserName(),
passwordReset.getMobileNumber()
@@ -94,13 +94,16 @@ public class PortalUserAuthService implements UserDetailsService {
return portalUserRepository.findPortalUserByEmailAddr(emailAddr).orElseThrow(() -> new UserNotFoundException("USER_NOT_FOUND_MESSAGE"));
}
public void initializePassword(String loginId, String userName, String mobileNumber) {
public void resetPassword(String loginId, String userName, String mobileNumber) {
PortalUser portalUser = portalUserRepository.findByLoginIdAndUserNameAndMobileNumber(loginId, userName, mobileNumber)
.orElseThrow(() -> new UserNotFoundException("일치하는 사용자 정보를 찾을 수 없습니다."));
String tempPassword = EncryptionUtil.generateNewPasswordForKjbank(loginId);
portalUser.setPasswordHash(passwordEncoder.encode(tempPassword));
if ("Y".equalsIgnoreCase(portalUser.getAccountLockYn())) {
portalUser.setAccountLockYn("N");
}
portalUserRepository.save(portalUser);
HashMap<String, Object> params = new HashMap<>();