mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
Improve captch erorr handling on invalid input
This commit is contained in:
parent
83cff3f66d
commit
ccc0b10ea0
@ -57,8 +57,11 @@ public class RecaptchaService {
|
|||||||
if (success != null && !success) {
|
if (success != null && !success) {
|
||||||
final List<String> errorCodes = (List<String>) responseBody.get("error-codes");
|
final List<String> errorCodes = (List<String>) responseBody.get("error-codes");
|
||||||
String errorCode = errorCodes.get(0);
|
String errorCode = errorCodes.get(0);
|
||||||
if (errorCode.equals(CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE) || errorCodes.equals(CATCHA_ERROR_CODE_INPUT_RESPONSE)) {
|
if (errorCode.equals(CATCH_ERROR_CODE_TIMEOUT_OR_DUPLICATE)) {
|
||||||
result = Messages.CAPTCHA_TIMEOUT_OUT_DUPLICATE;
|
result = Messages.CAPTCHA_TIMEOUT_OUT_DUPLICATE;
|
||||||
|
|
||||||
|
} else if (errorCode.equals("invalid-input-response")) {
|
||||||
|
result = Messages.CAPTCHA_INVALID_INPUT_RESPONSE;
|
||||||
} else {
|
} else {
|
||||||
result = Messages.CAPTCHA_LOADING_ERROR;
|
result = Messages.CAPTCHA_LOADING_ERROR;
|
||||||
logger.error("Unexpected error during catch resolution:" + errorCodes);
|
logger.error("Unexpected error during catch resolution:" + errorCodes);
|
||||||
|
@ -28,4 +28,5 @@ public interface Messages {
|
|||||||
String CAPTCHA_LOADING_ERROR = "CAPTCHA_LOADING_ERROR";
|
String CAPTCHA_LOADING_ERROR = "CAPTCHA_LOADING_ERROR";
|
||||||
|
|
||||||
String CAPTCHA_TIMEOUT_OUT_DUPLICATE = "CAPTCHA_TIMEOUT_OUT_DUPLICATE";
|
String CAPTCHA_TIMEOUT_OUT_DUPLICATE = "CAPTCHA_TIMEOUT_OUT_DUPLICATE";
|
||||||
|
String CAPTCHA_INVALID_INPUT_RESPONSE = "CAPTCHA_INVALID_INPUT_RESPONSE";
|
||||||
}
|
}
|
||||||
|
@ -51,4 +51,5 @@ TRY_WELCOME = This edition space showcases some of the mindmap editor capabiliti
|
|||||||
UNEXPECTED_ERROR_DETAILS = Unexpected error processing request.
|
UNEXPECTED_ERROR_DETAILS = Unexpected error processing request.
|
||||||
NO_ENOUGH_PERMISSIONS=This mind map can opened.
|
NO_ENOUGH_PERMISSIONS=This mind map can opened.
|
||||||
NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted.
|
NO_ENOUGH_PERMISSIONS_DETAILS=You do not have enough right access to see this map. This map has been changed to private or deleted.
|
||||||
CAPTCHA_TIMEOUT_OUT_DUPLICATE="Please, refresh the page and try again."
|
CAPTCHA_TIMEOUT_OUT_DUPLICATE=Please, refresh the page and try again.
|
||||||
|
CAPTCHA_INVALID_INPUT_RESPONSE="Invalid input response, refresh the page and try again.
|
Loading…
Reference in New Issue
Block a user