springboot-devtools 변경, two_factor_auth 코드 변경
This commit is contained in:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user