Skip to content

Commit

Permalink
Merge pull request #174 from 4bujak-4bujak/develop
Browse files Browse the repository at this point in the history
refactor: #136 문자 전송 및 인증 서비스 재활성화
  • Loading branch information
zoomin3022 authored Jun 13, 2024
2 parents 908a7f0 + a634b34 commit 78e35de
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 78e35de

Please sign in to comment.