Skip to content

Commit a868155

Browse files
authored
Merge pull request #278 from rupato-deriv/Rupato/Fix--oidc-account-list
fix: oidc check
2 parents 8116530 + 72f4a04 commit a868155

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/components/layout/index.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ const Layout = () => {
2020
const isLoggedInCookie = Cookies.get('logged_state') === 'true';
2121
const isEndpointPage = window.location.pathname.includes('endpoint');
2222
const checkClientAccount = JSON.parse(localStorage.getItem('clientAccounts') ?? '{}');
23-
const checkAccountList = JSON.parse(localStorage.getItem('accountList') ?? '{}');
23+
const checkAccountList = api_base?.account_info?.account_list ?? {};
24+
const areAccountsEqual = Object.keys(checkClientAccount).length === Object.keys(checkAccountList).length;
2425

25-
console.log('clientAccounts', { checkClientAccount, checkAccountList, api_base });
26+
console.log('clientAccounts', {
27+
checkClientAccount,
28+
checkAccountList,
29+
account_list: api_base?.account_info?.account_list,
30+
areAccountsEqual,
31+
});
2632

2733
useEffect(() => {
2834
if (isLoggedInCookie && isOAuth2Enabled && !isEndpointPage && !isCallbackPage) {

0 commit comments

Comments
 (0)