Add password reset GUI and processing
This commit is contained in:
@@ -11,6 +11,8 @@
|
|||||||
},
|
},
|
||||||
"bodyContent": {
|
"bodyContent": {
|
||||||
"confirmEmail": "Welcome to {SERVERNAME}!\nPlease confirm your email by using the command /verifyemail in-game.\n\nYour verification code is: {VERIFICATIONCODE}",
|
"confirmEmail": "Welcome to {SERVERNAME}!\nPlease confirm your email by using the command /verifyemail in-game.\n\nYour verification code is: {VERIFICATIONCODE}",
|
||||||
|
"confirmPasswordReset": "You (or someone else) requested to reset your password on {SERVERNAME}!\nPlease confirm this request by entering the code below into the password reset window in-game.\n\nYour verification code is: {VERIFICATIONCODE}\n\n\nIf you did not request a password reset, then there's nothing to worry about since your password can only be reset with the code above.",
|
||||||
|
"passwordChanged": "Your password on {SERVERNAME} has been changed successfully!",
|
||||||
"emailConfirmed": "Your email has been confirmed on {SERVERNAME}!\nYou may now use this email to reset your password, require two-factor authentication on login, receive offline notifications, and more!",
|
"emailConfirmed": "Your email has been confirmed on {SERVERNAME}!\nYou may now use this email to reset your password, require two-factor authentication on login, receive offline notifications, and more!",
|
||||||
"twoFactorAuthentication": "Please enter the following code to continue on {SERVERNAME} for {GAMENAME}: {2FACODE}",
|
"twoFactorAuthentication": "Please enter the following code to continue on {SERVERNAME} for {GAMENAME}: {2FACODE}",
|
||||||
"accountAuthSuccessAlert": "You or someone else has successfully logged in to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
|
"accountAuthSuccessAlert": "You or someone else has successfully logged in to your account on {SERVERNAME} for {GAMENAME}.\nIP Address: {IPADDRESS}\nLocation: {LOCATION}\nTimestamp: {TIMESTAMP}",
|
||||||
|
|||||||
@@ -158,12 +158,15 @@ function showChangePasswordGUI() {
|
|||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
passwordChange.window.shown = true;
|
passwordChange.window.shown = true;
|
||||||
|
mexui.focusedControl = passwordChange.passwordInput;
|
||||||
|
guiSubmitKey = checkChangePassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function passwordChangeSuccess() {
|
function passwordChangeSuccess() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password change was successful`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password change was successful`);
|
||||||
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -131,7 +131,8 @@ function showResetPasswordGUI() {
|
|||||||
setChatWindowEnabled(false);
|
setChatWindowEnabled(false);
|
||||||
mexui.setInput(true);
|
mexui.setInput(true);
|
||||||
resetPassword.window.shown = true;
|
resetPassword.window.shown = true;
|
||||||
|
mexui.focusedControl = resetPassword.emailInput;
|
||||||
|
guiSubmitButton = checkResetPassword;
|
||||||
showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
showSmallGameMessage(`If you don't have a mouse cursor, press ${toUpperCase(getKeyNameFromId(disableGUIKey))} to disable GUI`, COLOUR_WHITE, 7500);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -153,14 +154,21 @@ function resetPasswordFailed(errorMessage) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function resetPasswordSuccess() {
|
function resetPasswordCodeStep() {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password reset was successful`);
|
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password reset was successful`);
|
||||||
|
|
||||||
|
resetPassword.messageLabel.text = "Check your email for a reset code";
|
||||||
|
resetPassword.messageLabel.styles.main.textColour = toColour(180, 32, 32, 255);
|
||||||
|
resetPassword.emailInput.text = "";
|
||||||
|
|
||||||
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function switchToLoginGUI() {
|
function switchToLoginGUI() {
|
||||||
|
guiSubmitKey = false;
|
||||||
closeAllWindows();
|
closeAllWindows();
|
||||||
showLoginGUI();
|
showLoginGUI();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,6 +258,9 @@ class ClientData {
|
|||||||
this.currentAnimationPositionReturnTo = false;
|
this.currentAnimationPositionReturnTo = false;
|
||||||
this.animationStart = 0;
|
this.animationStart = 0;
|
||||||
this.animationForced = false;
|
this.animationForced = false;
|
||||||
|
|
||||||
|
this.passwordResetState = VRR_RESETPASS_STATE_NONE;
|
||||||
|
this.passwordResetCode = "";
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,8 @@ function addAllNetworkHandlers() {
|
|||||||
// Account
|
// Account
|
||||||
addNetworkHandler("vrr.checkLogin", checkLogin);
|
addNetworkHandler("vrr.checkLogin", checkLogin);
|
||||||
addNetworkHandler("vrr.checkRegistration", checkRegistration);
|
addNetworkHandler("vrr.checkRegistration", checkRegistration);
|
||||||
|
addNetworkHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest);
|
||||||
|
addNetworkHandler("vrr.checkChangePassword", checkAccountChangePassword);
|
||||||
|
|
||||||
// Developer
|
// Developer
|
||||||
addNetworkHandler("vrr.runCodeSuccess", clientRunCodeSuccess);
|
addNetworkHandler("vrr.runCodeSuccess", clientRunCodeSuccess);
|
||||||
@@ -288,6 +290,13 @@ function sendJobRouteStopToPlayer(client, position, colour) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
|
function showPlayerChangePasswordGUI(client) {
|
||||||
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending change password GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
|
triggerNetworkEvent("vrr.changePassword", client);
|
||||||
|
}
|
||||||
|
|
||||||
|
// ===========================================================================
|
||||||
|
|
||||||
function showPlayerLoginSuccessGUI(client) {
|
function showPlayerLoginSuccessGUI(client) {
|
||||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(client)}`);
|
||||||
triggerNetworkEvent("vrr.loginSuccess", client);
|
triggerNetworkEvent("vrr.loginSuccess", client);
|
||||||
|
|||||||
@@ -292,9 +292,9 @@ const VRR_2FA_STATE_CODEINPUT = 1; // Waiting on player to enter c
|
|||||||
const VRR_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
|
const VRR_2FA_STATE_SETUP_CODETOAPP = 2; // Providing player with a code to put in their auth app
|
||||||
const VRR_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
|
const VRR_2FA_STATE_SETUP_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
|
||||||
|
|
||||||
const VRR_FORGOTPASS_STATE_NONE = 0; // None
|
const VRR_RESETPASS_STATE_NONE = 0; // None
|
||||||
const VRR_FORGOTPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
|
const VRR_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
|
||||||
const VRR_FORGOTPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
|
const VRR_RESETPASS_STATE_SETPASS = 2; // Waiting on player to enter new password
|
||||||
|
|
||||||
const VRR_NPC_COND_MATCH_NONE = 0; // None (invalid)
|
const VRR_NPC_COND_MATCH_NONE = 0; // None (invalid)
|
||||||
const VRR_NPC_COND_MATCH_EQ = 1; // Must be equal to
|
const VRR_NPC_COND_MATCH_EQ = 1; // Must be equal to
|
||||||
|
|||||||
Reference in New Issue
Block a user