diff --git a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/connector/recaptcha/EmailOTPCaptchaConnector.java b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/connector/recaptcha/EmailOTPCaptchaConnector.java index 9b28855a7e..e2bbeee2ba 100644 --- a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/connector/recaptcha/EmailOTPCaptchaConnector.java +++ b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/connector/recaptcha/EmailOTPCaptchaConnector.java @@ -61,7 +61,7 @@ public class EmailOTPCaptchaConnector extends AbstractReCaptchaConnector { public static final String EMAIL_OTP_AUTHENTICATOR_NAME = "EmailOTP"; public static final String IS_REDIRECT_TO_EMAIL_OTP = "isRedirectToEmailOTP"; public static final String RESEND_CODE = "resendCode"; - private static final String ON_FAIL_REDIRECT_URL = "/authenticationendpoint/login.do"; + private static final String ON_FAIL_REDIRECT_URL = "/authenticationendpoint/email_otp.do"; private static final String EMAIL_OTP_LOGIN_ATTEMPT_FAIL_CLAIM = "http://wso2.org/claims/identity/failedEmailOtpAttempts"; private static final String RECAPTCHA_PARAM = "reCaptcha"; private static final String AUTH_FAILURE = "authFailure"; diff --git a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java index 8162079049..6496f2333a 100644 --- a/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java +++ b/components/org.wso2.carbon.identity.captcha/src/main/java/org/wso2/carbon/identity/captcha/util/CaptchaUtil.java @@ -190,7 +190,7 @@ public static String getOnFailRedirectUrl(String redirectURL, List onFai // Check whether the flow is authentication related. if (isAuthenticationFlow) { for (String url : onFailRedirectUrls) { - if (!StringUtils.isBlank(url) && url.equalsIgnoreCase(uriBuilder.getPath())) { + if (!StringUtils.isBlank(uriBuilder.getPath()) && uriBuilder.getPath().contains(url)) { return getUpdatedUrl(redirectURL, attributes); } }