throws
IOException
{
- PasswordResetRequest resetRequest = passwordRestService.requestPasswordReset(email);
+ PasswordResetRequest resetRequest = passwordRestService.request(email);
httpServletResponse.sendRedirect(resetRequest.getUserId().toString());
}
@GetMapping("/{id}")
public ModelAndView getResetRequest(@PathVariable UUID id)
{
- PasswordResetRequest resetRequest = passwordRestService.getPasswordReset(id);
+ PasswordResetRequest resetRequest = passwordRestService.get(id);
ModelAndView mav = new ModelAndView("confirm");
return "confirm";
}
try
{
PasswordResetRequest resetRequest =
- passwordRestService.confirmPasswordRequest(
+ passwordRestService.confirm(
id,
code,
password);
import lombok.Data;
+import java.time.ZonedDateTime;
import java.util.Optional;
import java.util.UUID;
private String code;
private String password;
private Status status;
+ private ZonedDateTime created;
+ private ZonedDateTime confirmed;
+ private ZonedDateTime accomplihed;
}
public interface PasswordRestService
{
- PasswordResetRequest requestPasswordReset(String email);
- PasswordResetRequest getPasswordReset();
- PasswordResetRequest confirmPasswordRequest(UUID requestId, String code, String password);
+ enum Progress
+ {
+ CREATED,
+ CONFIRMED,
+ ACCOMPLISHED
+ }
+
+ PasswordResetRequest request(String email);
+ PasswordResetRequest get();
+ PasswordResetRequest confirm(UUID requestId, String code, String password);
}