first commit
This commit is contained in:
@@ -30,6 +30,10 @@ public class CodeServ {
|
||||
return code.getCode();
|
||||
}
|
||||
|
||||
public void deleteCode(String email) {
|
||||
codeRepo.deleteById(email);
|
||||
}
|
||||
|
||||
private void lazyDeleteCode() {
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if (lazyCleanTime.isBefore(now.minusSeconds(Constant.VALID_CODE_EXPIRE_SECONDS))) {
|
||||
|
||||
@@ -70,6 +70,7 @@ public class UserServ {
|
||||
if (!Objects.equals(code, codeServ.getCode(email))) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
codeServ.deleteCode(email);
|
||||
}
|
||||
|
||||
private void validEmail(String email) {
|
||||
|
||||
Reference in New Issue
Block a user