mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-13 05:27:15 -08:00
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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user