Skip to content

Commit d5265f6

Browse files
authored
Merge pull request #964 from vinu-deriv/fix-account-switching
fix: fix the account switching issue from tradershub to smarttrader
2 parents 807821c + 1b61ce5 commit d5265f6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/javascript/app/pages/sso-loader.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ export const init = () => {
88
const clientAccounts = JSON.parse(
99
localStorage.getItem('client.accounts') || '{}'
1010
);
11+
12+
const url_params = new URLSearchParams(window.location.search);
13+
const account = url_params.get('account');
14+
if (account) {
15+
sessionStorage.setItem('account', account);
16+
}
17+
1118
const isClientAccountsPopulated = Object.keys(clientAccounts).length > 0;
1219
const willEventuallySSO =
1320
loggedState === 'true' && !isClientAccountsPopulated;

0 commit comments

Comments
 (0)