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.data:spring-data-envers'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-jdbc'
|
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 'org.springframework:spring-expression:5.3.30'
|
||||||
|
|
||||||
implementation group: 'xalan', name: 'xalan', version: '2.7.3'
|
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) {
|
public void saveAuthNumber(String recipientKey, String authNumber, LocalDateTime expiresAt) {
|
||||||
|
twoFactorAuthRepository.deleteAllByRecipient(recipientKey);
|
||||||
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);
|
TwoFactorAuth auth = new TwoFactorAuth(recipientKey, authNumber, expiresAt);
|
||||||
twoFactorAuthRepository.save(auth);
|
twoFactorAuthRepository.save(auth);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public Optional<TwoFactorAuth> getAuthNumber(String recipientKey) {
|
public Optional<TwoFactorAuth> getAuthNumber(String recipientKey) {
|
||||||
return twoFactorAuthRepository.findByRecipient(recipientKey);
|
return twoFactorAuthRepository.findByRecipient(recipientKey);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user