Skip to content

Commit

Permalink
Amina/logout client on reset binary.com password from all existing ac…
Browse files Browse the repository at this point in the history
…tive sessions. (binary-com#6728)

* logout client from all tabs

* test run

* remove Login.redirectToLogin

* invalid_token

* invalid_token
  • Loading branch information
amina-deriv authored Aug 30, 2021
1 parent 830ce76 commit df64553
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/javascript/app/base/socket_general.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@ const BinarySocketGeneral = (() => {
case 'DisabledClient':
showNoticeMessage(response.error.message);
break;

case 'InvalidToken':
Client.sendLogoutRequest(true);
break;

// no default
}
};
Expand Down
3 changes: 2 additions & 1 deletion src/javascript/app/pages/user/reset_password.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const getElementById = require('../../../_common/common_functions').getElementBy
const localize = require('../../../_common/localize').localize;
const State = require('../../../_common/storage').State;
const toTitleCase = require('../../../_common/string_util').toTitleCase;
const Client = require('../../base/client');

const ResetPassword = (() => {
let form_reset_pw_id,
Expand Down Expand Up @@ -49,7 +50,7 @@ const ResetPassword = (() => {
localized_message: localize('You have a new Binary password to log in to Binary.com.'),
localized_title : localize('Success'),
ok_text : localize('Done'),
onConfirm : () => Login.redirectToLogin(true),
onConfirm : () => Client.sendLogoutRequest(true),
});
}
};
Expand Down

0 comments on commit df64553

Please sign in to comment.