diff --git a/.changeset/yellow-rocks-destroy.md b/.changeset/yellow-rocks-destroy.md new file mode 100644 index 00000000000..1f5125ba5ca --- /dev/null +++ b/.changeset/yellow-rocks-destroy.md @@ -0,0 +1,5 @@ +--- +"@wso2is/identity-apps-core": patch +--- + +Fixed redirection issue in Go Back button in expired password reset error page diff --git a/identity-apps-core/apps/recovery-portal/src/main/webapp/error.jsp b/identity-apps-core/apps/recovery-portal/src/main/webapp/error.jsp index cc75fad2ba2..a820eea65c0 100644 --- a/identity-apps-core/apps/recovery-portal/src/main/webapp/error.jsp +++ b/identity-apps-core/apps/recovery-portal/src/main/webapp/error.jsp @@ -1,5 +1,5 @@ <%-- - ~ Copyright (c) 2016-2023, WSO2 LLC. (https://www.wso2.com). + ~ Copyright (c) 2016-2024, WSO2 LLC. (https://www.wso2.com). ~ ~ WSO2 LLC. licenses this file to you under the Apache License, ~ Version 2.0 (the "License"); you may not use this file except @@ -44,6 +44,7 @@ String errorMsg = IdentityManagementEndpointUtil.getStringValue(request.getAttribute("errorMsg")); String errorCode = IdentityManagementEndpointUtil.getStringValue(request.getAttribute("errorCode")); String invalidConfirmationErrorCode = IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_INVALID_CODE.getCode(); + String expiredConfirmationErrorCode = IdentityRecoveryConstants.ErrorMessages.ERROR_CODE_EXPIRED_CODE.getCode(); String callback = request.getParameter("callback"); boolean isValidCallback = true; @@ -204,10 +205,11 @@ var errorCodeFromParams = "<%=errorCode%>"; var invalidConfirmationErrorCode = "<%=invalidConfirmationErrorCode%>"; + var expiredConfirmationErrorCode = "<%=expiredConfirmationErrorCode%>"; - // Check if the error is related to the confirmation code being invalid. + // Check if the error is related to the confirmation code being invalid or expired. // If so, navigate the users to the URL defined in `callback` URL param. - if (errorCodeFromParams === invalidConfirmationErrorCode) { + if (errorCodeFromParams === invalidConfirmationErrorCode || errorCodeFromParams === expiredConfirmationErrorCode) { window.location.href = "<%=Encode.forHtmlAttribute(callback)%>"; return;