Issue
-
While validating the captcha in the custom module, the following exception shows:
"CAPTCHA text is null. User null may be trying to circumvent the CAPTCHA."
-
Steps to reproduce:
-
Deploy my-test-captcha-1.0.0.jar. This is located in the /build/lib.
-
Add it to a page, as a widget. It's under Sample, or you can search for it.
-
Input an email and the Captcha text.
Actual Result: CAPTCHA Verification will fail.
Expected Result: CAPTCHA Verification is successful.
Note: This only happens with a custom captcha portlet, the captcha components from the portal (Example: "forgot password" page) are working as expected. -
Environment
- Liferay DXP 7.4
Resolution
- Previously, there were 2 methods named as serveImage in CaptchaUtil:
# method 1:
serveImage(ResourceRequest resourceRequest, ResourceResponse resourceResponse)# method 2:
serveImage(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) - However, this LPS-181665: Remove method references in CaptchaUtil removed method 1, and only method 2 is available now, therefore all usages of method 1 should be adapted to invoke method 2 only.
- This has been addressed in LPS-196214.
Additional Information