| Total Complexity | 4 |
| Total Lines | 23 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.osomapps.pt.tokenemail; |
||
| 13 | @RestController |
||
| 14 | @RequestMapping("email/reset") |
||
| 15 | class EmailResetResource { |
||
| 16 | |||
| 17 | private final TokenEmailSignupService tokenEmailSignupService; |
||
| 18 | |||
| 19 | @Autowired |
||
| 20 | EmailResetResource(TokenEmailSignupService tokenEmailSignupService) { |
||
| 21 | this.tokenEmailSignupService = tokenEmailSignupService; |
||
| 22 | } |
||
| 23 | |||
| 24 | @GetMapping |
||
| 25 | List<InUser> list() { |
||
| 26 | return Collections.emptyList(); |
||
| 27 | } |
||
| 28 | |||
| 29 | @GetMapping("{resetToken}") |
||
| 30 | String create(@PathVariable String resetToken) { |
||
| 31 | final Optional<String> newPassword = tokenEmailSignupService.resetToken(resetToken); |
||
| 32 | if (newPassword.isPresent()) { |
||
| 33 | return "Your password was reseted to the " + newPassword.get(); |
||
| 34 | } |
||
| 35 | return ""; |
||
| 36 | } |
||
| 38 |