Enabled captcha for registration

This commit is contained in:
Rohan Sircar 2020-01-09 12:54:15 +05:30
parent ff33817930
commit 220a071ecc

View File

@ -66,11 +66,12 @@ public class RegistrationController {
logger.debug("Captcha text from captcha map = {}", captchaMap.get(userRegistrationDTO.getCaptchaID())); logger.debug("Captcha text from captcha map = {}", captchaMap.get(userRegistrationDTO.getCaptchaID()));
if (userRegistrationDTO.getCaptchaInput().equals(captchaMap.get(userRegistrationDTO.getCaptchaID()))) { if (userRegistrationDTO.getCaptchaInput().equals(captchaMap.get(userRegistrationDTO.getCaptchaID()))) {
logger.info("Registration captcha equal success"); logger.info("Registration captcha equal success");
userService.registerUser(userRegistrationDTO);
return "redirect:registration?success";
} else { } else {
logger.warn("Registration captcha equal fail"); logger.warn("Registration captcha equal fail");
return "redirect:registration?error";
} }
userService.registerUser(userRegistrationDTO);
return "user/home";
} }
@GetMapping(value = "/img/captcha/{image_id}", produces = MediaType.IMAGE_PNG_VALUE) @GetMapping(value = "/img/captcha/{image_id}", produces = MediaType.IMAGE_PNG_VALUE)