Support Server requests for MFA, Render failed UI statuses to user, C… (#4483)

* Support Server requests for MFA, Render failed UI statuses to user, Connect to KnownHosts component
This commit is contained in:
Zach H
2021-11-23 02:45:08 -05:00
committed by GitHub
parent 73c5956ece
commit 0683d1aced
12 changed files with 168 additions and 91 deletions

View File

@@ -268,11 +268,14 @@ export class SessionCommands {
const resp = raw['.Response_ForgotPasswordRequest.ext'];
if (resp.challengeEmail) {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Requesting MFA information');
SessionPersistence.resetPasswordChallenge();
} else {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password reset in progress');
SessionPersistence.resetPassword();
}
} else {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password reset failed, please try again');
SessionPersistence.resetPasswordFailed();
}
@@ -298,8 +301,10 @@ export class SessionCommands {
webClient.protobuf.sendSessionCommand(sc, raw => {
if (raw.responseCode === webClient.protobuf.controller.Response.ResponseCode.RespOk) {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password reset in progress');
SessionPersistence.resetPassword();
} else {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password reset failed, please try again');
SessionPersistence.resetPasswordFailed();
}
@@ -326,8 +331,10 @@ export class SessionCommands {
webClient.protobuf.sendSessionCommand(sc, raw => {
if (raw.responseCode === webClient.protobuf.controller.Response.ResponseCode.RespOk) {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password successfully updated');
SessionPersistence.resetPasswordSuccess();
} else {
SessionCommands.updateStatus(StatusEnum.DISCONNECTED, 'Password update failed, please try again');
SessionPersistence.resetPasswordFailed();
}

View File

@@ -82,7 +82,7 @@ export class SessionPersistence {
}
static resetPasswordChallenge() {
console.log('Open Modal asking for Email address associated with account');
ServerDispatch.resetPasswordChallenge();
}
static resetPassword() {
@@ -90,10 +90,10 @@ export class SessionPersistence {
}
static resetPasswordSuccess() {
console.log('User password successfully changed Alert!');
ServerDispatch.resetPasswordSuccess();
}
static resetPasswordFailed() {
console.log('Open Alert telling user their password request failed for some reason');
ServerDispatch.resetPasswordFailed();
}
}