diff --git a/WebRoot/js/zimbraMail/share/view/dialog/ZmPasswordRecoveryDialog.js b/WebRoot/js/zimbraMail/share/view/dialog/ZmPasswordRecoveryDialog.js
index d7e45f653d..bda8fa3bc2 100644
--- a/WebRoot/js/zimbraMail/share/view/dialog/ZmPasswordRecoveryDialog.js
+++ b/WebRoot/js/zimbraMail/share/view/dialog/ZmPasswordRecoveryDialog.js
@@ -31,6 +31,7 @@
ZmPasswordRecoveryDialog =
function(params) {
this.accountInput = params.accountInput || '';
+ this.contextPath = params.contextPath || '';
var emailSubmitButton = new DwtDialog_ButtonDescriptor(ZmPasswordRecoveryDialog.EMAIL_SUBMIT_BUTTON,
ZmMsg.passwordRecoveryButtonSubmit,
@@ -126,7 +127,7 @@ function() {
this._twoFactorCodeDivId = id + '_two_factor_code';
this._divIdArray = [this._getRecoveryAccountDivId, this._requestCodeDivId, this._validateCodeDivId, this._codeSuccessDivId, this._resetPasswordDivId, this._passwordResetSuccessDivId, this._twoFactorCodeDivId];
- return AjxTemplate.expand('share.Dialogs#ZmPasswordRecovery', {id : id, accountInput : this.accountInput});
+ return AjxTemplate.expand('share.Dialogs#ZmPasswordRecovery', {id : id, accountInput : this.accountInput, contextPath : this.contextPath});
};
/**
@@ -386,7 +387,7 @@ function(result) {
Dwt.hide(this._trustedDeviceDiv);
}
} else {
- location.replace(location.origin);
+ location.replace(location.origin + this.contextPath);
}
}
@@ -1087,7 +1088,7 @@ function() {
ZmPasswordRecoveryDialog.prototype._handleCancelResetPasswordRequest =
function () {
- location.replace(location.origin);
+ location.replace(location.origin + this.contextPath);
}
/**
@@ -1121,6 +1122,6 @@ function(result) {
this._handleResetPasswordError(this._validateTwoFactorErrorDiv, this._validateTwoFactorErrorMessageDiv, result.getException());
} else {
this.setButtonEnabled(ZmPasswordRecoveryDialog.TWO_FACTOR_VERIFY_BUTTON, false);
- location.replace(location.origin);
+ location.replace(location.origin + this.contextPath);
}
}
\ No newline at end of file
diff --git a/WebRoot/public/PasswordRecovery.jsp b/WebRoot/public/PasswordRecovery.jsp
index e38b754d4b..76e681cca8 100644
--- a/WebRoot/public/PasswordRecovery.jsp
+++ b/WebRoot/public/PasswordRecovery.jsp
@@ -47,6 +47,7 @@
if (contextPath.equals("/")) {
contextPath = "";
}
+ pageContext.setAttribute("contextPath", contextPath);
boolean isDevMode = getParameter(request, "dev", "0").equals("1");
pageContext.setAttribute("isDevMode", isDevMode);
@@ -98,7 +99,8 @@
DBG = new AjxDebug(AjxDebug.NONE, null, false);
}
var params = {
- accountInput : "<%=accountInput%>"
+ accountInput : "<%=accountInput%>",
+ contextPath : "<%=contextPath%>"
};
new ZmPasswordRecoveryDialog(params).popup();
var changeTag = document.getElementsByClassName("DwtDialogTitle")[0];
diff --git a/WebRoot/public/login.jsp b/WebRoot/public/login.jsp
index 4449eff2f6..d7d52b37a3 100644
--- a/WebRoot/public/login.jsp
+++ b/WebRoot/public/login.jsp
@@ -41,6 +41,9 @@