springboot-devtools 변경, two_factor_auth 코드 변경

This commit is contained in:
Rinjae
2025-10-17 19:27:38 +09:00
parent 8874c41104
commit 99d084cb7d
2 changed files with 4 additions and 13 deletions
+1 -1
View File
@@ -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'
@@ -18,20 +18,11 @@ public class AuthNumberStorage {
}
public void saveAuthNumber(String recipientKey, String authNumber, LocalDateTime expiresAt) {
Optional<TwoFactorAuth> exist = twoFactorAuthRepository.findByRecipient(recipientKey);
if (exist.isPresent()) {
TwoFactorAuth old = exist.get();
old.setAuthNumber(authNumber);
old.setExpiresAt(expiresAt);
twoFactorAuthRepository.save(old);
} else {
twoFactorAuthRepository.deleteAllByRecipient(recipientKey);
TwoFactorAuth auth = new TwoFactorAuth(recipientKey, authNumber, expiresAt);
twoFactorAuthRepository.save(auth);
}
}
public Optional<TwoFactorAuth> getAuthNumber(String recipientKey) {
return twoFactorAuthRepository.findByRecipient(recipientKey);
}