From 99d084cb7dbd78c1fff90a1392ca3043ff0ce65c Mon Sep 17 00:00:00 2001 From: Rinjae Date: Fri, 17 Oct 2025 19:27:38 +0900 Subject: [PATCH] =?UTF-8?q?springboot-devtools=20=EB=B3=80=EA=B2=BD,=20two?= =?UTF-8?q?=5Ffactor=5Fauth=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 2 +- .../apps/auth/service/AuthNumberStorage.java | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index e1b77c8..27c8ddc 100644 --- a/build.gradle +++ b/build.gradle @@ -43,7 +43,7 @@ dependencies { implementation 'org.springframework.data:spring-data-envers' implementation 'org.springframework.boot:spring-boot-starter-jdbc' - runtimeOnly 'org.springframework.boot:spring-boot-devtools' + developmentOnly 'org.springframework.boot:spring-boot-devtools' implementation 'org.springframework:spring-expression:5.3.30' implementation group: 'xalan', name: 'xalan', version: '2.7.3' diff --git a/src/main/java/com/eactive/apim/portal/apps/auth/service/AuthNumberStorage.java b/src/main/java/com/eactive/apim/portal/apps/auth/service/AuthNumberStorage.java index 85acad1..0e77bd5 100644 --- a/src/main/java/com/eactive/apim/portal/apps/auth/service/AuthNumberStorage.java +++ b/src/main/java/com/eactive/apim/portal/apps/auth/service/AuthNumberStorage.java @@ -18,18 +18,9 @@ public class AuthNumberStorage { } public void saveAuthNumber(String recipientKey, String authNumber, LocalDateTime expiresAt) { - - Optional exist = twoFactorAuthRepository.findByRecipient(recipientKey); - if (exist.isPresent()) { - TwoFactorAuth old = exist.get(); - old.setAuthNumber(authNumber); - old.setExpiresAt(expiresAt); - twoFactorAuthRepository.save(old); - } else { - TwoFactorAuth auth = new TwoFactorAuth(recipientKey, authNumber, expiresAt); - twoFactorAuthRepository.save(auth); - } - + twoFactorAuthRepository.deleteAllByRecipient(recipientKey); + TwoFactorAuth auth = new TwoFactorAuth(recipientKey, authNumber, expiresAt); + twoFactorAuthRepository.save(auth); } public Optional getAuthNumber(String recipientKey) {