Skip to content

Commit

Permalink
Mahdiyeh/ logout client when enable or disable 2FA in different windo…
Browse files Browse the repository at this point in the history
…ws (#6062)

* logout client when enable or disable 2FA in different windows

* use json.parse to check the loginid

* remove Uncaught SyntaxError in Json.parse

Co-authored-by: Carol Sachdeva <58209918+carol-binary@users.noreply.github.com>
  • Loading branch information
mahdiyeh-deriv and carolsachdeva committed Sep 27, 2022
1 parent 7c8fa44 commit 50db790
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/App/initStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ const setStorageEvents = root_store => {
break;
}
case 'active_loginid':
if (localStorage.getItem('active_loginid') === 'null' || !localStorage.getItem('active_loginid')) {
root_store.client.logout();
}
if (document.hidden) {
window.location.reload();
}
Expand Down

0 comments on commit 50db790

Please sign in to comment.