Skip to content

Commit

Permalink
refactor: #136 문자 전송 및 인증 서비스 재활성화
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomin3022 committed Jun 13, 2024
1 parent 2706517 commit a634b34
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void requestPhoneVerify(VerifyRequestDto.Phone phone) {

redisService.set(PHONE_CODE_PREFIX + phone.phoneNumber(), verificationCode, (long) PHONE_CODE_EXPIRATION_MILLIS);

//smsService.sendSms(phone.phoneNumber(), createSmsVerificationText(verificationCode));
smsService.sendSms(phone.phoneNumber(), createSmsVerificationText(verificationCode));
}

private String generateVerifyCode() {
Expand All @@ -142,12 +142,12 @@ private Message createSmsVerificationText(String verificationCode) {
}

public boolean verifyPhoneCode(VerifyRequestDto.PhoneCode phoneCode) {
// String codeInRedis = redisService.get(PHONE_CODE_PREFIX + phoneCode.phoneNumber(), String.class)
// .orElseThrow(() -> new AuthException(EXPIRED_PHONE_CODE));
//
// if (!codeInRedis.equals(phoneCode.code())) {
// throw new AuthException(INVALID_PHONE_CODE);
// }
String codeInRedis = redisService.get(PHONE_CODE_PREFIX + phoneCode.phoneNumber(), String.class)
.orElseThrow(() -> new AuthException(EXPIRED_PHONE_CODE));

if (!codeInRedis.equals(phoneCode.code())) {
throw new AuthException(INVALID_PHONE_CODE);
}
return true;
}

Expand Down

0 comments on commit a634b34

Please sign in to comment.