Skip to content

Commit

Permalink
Adrienne / Fix self exclusion not logging out with OIDC (#18078)
Browse files Browse the repository at this point in the history
* feat: store redirect metadata for traders hub from os-redirect

* Merge branch 'master' of github.com:deriv-com/deriv-app

* chore: fix self exclusion not logging out

* chore: fix self exclusion not logging out

* chore: remove unrelated changes caused by linter

* chore: remove unrelated changes caused by linter

* chore: fix linting issue with formatting
  • Loading branch information
adrienne-deriv authored Feb 26, 2025
1 parent 607b19e commit 30d7a0f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/core/src/Services/socket-general.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { localize } from '@deriv/translations';
import ServerTime from '_common/base/server_time';
import BinarySocket from '_common/base/socket_base';
import WS from './ws-methods';
import { OAuth2Logout } from '@deriv-com/auth-client';

let client_store, common_store, gtm_store;
let reconnectionCounter = 1;
Expand Down Expand Up @@ -142,8 +143,14 @@ const BinarySocketGeneral = (() => {
const remaining_session_time = duration * 60 * 1000 - current_session_duration;
clearTimeout(session_timeout);
session_timeout = setTimeout(() => {
client_store.logout();
sessionStorage.removeItem('session_start_time');
OAuth2Logout({
WSLogoutAndRedirect: () => {
client_store.logout();
sessionStorage.removeItem('session_start_time');
},
redirectCallbackUri: `${window.location.origin}/callback`,
postLogoutRedirectUri: `${window.location.origin}/`
});
}, remaining_session_time);
} else if (!duration) {
clearTimeout(session_timeout);
Expand Down

0 comments on commit 30d7a0f

Please sign in to comment.