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