Skip to content

Commit

Permalink
refactor: #136 추가 과금 방지 위한 문자 전송 주석처리 및 검증 항상 true
Browse files Browse the repository at this point in the history
  • Loading branch information
zoomin3022 committed Jun 11, 2024
1 parent afadd3a commit 25b4b96
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 25b4b96

Please sign in to comment.