Add password reset GUI and processing
This commit is contained in:
@@ -158,12 +158,15 @@ function showChangePasswordGUI() {
|
||||
setChatWindowEnabled(false);
|
||||
mexui.setInput(true);
|
||||
passwordChange.window.shown = true;
|
||||
mexui.focusedControl = passwordChange.passwordInput;
|
||||
guiSubmitKey = checkChangePassword;
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function passwordChangeSuccess() {
|
||||
logToConsole(LOG_DEBUG, `[VRR.GUI] Server reports password change was successful`);
|
||||
guiSubmitKey = false;
|
||||
closeAllWindows();
|
||||
}
|
||||
|
||||
|
||||
@@ -131,7 +131,8 @@ function showResetPasswordGUI() {
|
||||
setChatWindowEnabled(false);
|
||||
mexui.setInput(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);
|
||||
}
|
||||
|
||||
@@ -153,14 +154,21 @@ function resetPasswordFailed(errorMessage) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function resetPasswordSuccess() {
|
||||
function resetPasswordCodeStep() {
|
||||
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();
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function switchToLoginGUI() {
|
||||
guiSubmitKey = false;
|
||||
closeAllWindows();
|
||||
showLoginGUI();
|
||||
}
|
||||
|
||||
@@ -258,6 +258,9 @@ class ClientData {
|
||||
this.currentAnimationPositionReturnTo = false;
|
||||
this.animationStart = 0;
|
||||
this.animationForced = false;
|
||||
|
||||
this.passwordResetState = VRR_RESETPASS_STATE_NONE;
|
||||
this.passwordResetCode = "";
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ function addAllNetworkHandlers() {
|
||||
// Account
|
||||
addNetworkHandler("vrr.checkLogin", checkLogin);
|
||||
addNetworkHandler("vrr.checkRegistration", checkRegistration);
|
||||
addNetworkHandler("vrr.checkResetPassword", checkAccountResetPasswordRequest);
|
||||
addNetworkHandler("vrr.checkChangePassword", checkAccountChangePassword);
|
||||
|
||||
// Developer
|
||||
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) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] Sending login success GUI signal to ${getPlayerDisplayForConsole(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_CODEFROMAPP = 3; // Waiting on player to enter code from auth app to set up
|
||||
|
||||
const VRR_FORGOTPASS_STATE_NONE = 0; // None
|
||||
const VRR_FORGOTPASS_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_NONE = 0; // None
|
||||
const VRR_RESETPASS_STATE_CODEINPUT = 1; // Waiting on player to enter code sent via email
|
||||
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_EQ = 1; // Must be equal to
|
||||
|
||||
Reference in New Issue
Block a user