Ask server to handle GUI response for pass reset

This commit is contained in:
Vortrex
2022-03-20 13:53:45 -05:00
parent 775dcf317a
commit 76673a42e8
2 changed files with 8 additions and 3 deletions

View File

@@ -186,9 +186,10 @@ function loginSuccess() {
// =========================================================================== // ===========================================================================
function switchToPasswordResetGUI() { function switchToPasswordResetGUI() {
closeAllWindows(); //closeAllWindows();
logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`); //logToConsole(LOG_DEBUG, `[VRR.GUI] Showing password reset dialog window`);
showResetPasswordGUI(); //showResetPasswordGUI();
sendNetworkEventToServer("vrr.checkResetPassword", "");
return false; return false;
} }

View File

@@ -980,6 +980,10 @@ function checkRegistration(client, password, confirmPassword = "", emailAddress
// =========================================================================== // ===========================================================================
function checkAccountResetPasswordRequest(client, inputText) { function checkAccountResetPasswordRequest(client, inputText) {
if(!checkForSMTPModule() || !getEmailConfig().enabled) {
return false;
}
if(getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_NONE) { if(getPlayerData(client).passwordResetState == VRR_RESETPASS_STATE_NONE) {
if(toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) { if(toLowerCase(getPlayerData(client).accountData.emailAddress) != toLowerCase(inputText)) {
logToConsole(LOG_DEBUG|LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`); logToConsole(LOG_DEBUG|LOG_WARN, `${getPlayerDisplayForConsole(client)} failed to reset their password (email not correct)`);