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
@@ -18,18 +18,9 @@ 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 {
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<TwoFactorAuth> getAuthNumber(String recipientKey) {