Skip to content

Commit

Permalink
๐Ÿšจ [HOTFIX] ์Šˆํผ ์ธ์ฆ๋ฒˆํ˜ธ ๋“ฑ๋ก
Browse files Browse the repository at this point in the history
  • Loading branch information
Jang99u committed Jan 24, 2025
1 parent 48c850d commit beb788b
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ public void verifyMessage(
// Redis์—์„œ ๊ฐ€์ ธ์˜ค๊ธฐ
String redisVerifyNumber = redisTemplate.opsForValue().get("cert:" + phoneNumber);

// 1) ๋งŒ๋ฃŒ ๋˜๋Š” ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ : ๋ ˆ๋””์Šค DB์— ์ €์žฅ X
if(redisVerifyNumber == null) {
throw BaseException.type(RedisErrorCode.EXPIRED_CERTIFICATION_NUMBER);
}
// 2) ์ธ์ฆ๋ฒˆํ˜ธ ๋ถˆ์ผ์น˜
if(!redisVerifyNumber.equals(verifyNumber)) {
throw BaseException.type(RedisErrorCode.INVALID_CERTIFICATION_NUMBER);
// ์Šˆํผ ์ธ์ฆ๋ฒˆํ˜ธ ๋“ฑ๋ก
if(!verifyNumber.equals("111111")) {
// 1) ๋งŒ๋ฃŒ ๋˜๋Š” ์กด์žฌํ•˜์ง€ ์•Š๋Š” ๊ฒฝ์šฐ : ๋ ˆ๋””์Šค DB์— ์ €์žฅ X
if(redisVerifyNumber == null) {
throw BaseException.type(RedisErrorCode.EXPIRED_CERTIFICATION_NUMBER);
}
// 2) ์ธ์ฆ๋ฒˆํ˜ธ ๋ถˆ์ผ์น˜
if(!redisVerifyNumber.equals(verifyNumber)) {
throw BaseException.type(RedisErrorCode.INVALID_CERTIFICATION_NUMBER);
}
}

// ๋ชจ๋‘ ์ •์ƒ์ธ ๊ฒฝ์šฐ : ๋ ˆ๋””์Šค DB ์—์„œ ์‚ญ์ œ ํ›„ ํœด๋Œ€ํฐ ๋ฒˆํ˜ธ ๊ฒ€์ฆ
redisTemplate.delete("cert:" + phoneNumber);

Expand Down

0 comments on commit beb788b

Please sign in to comment.