Skip to content

Commit

Permalink
Merge pull request #278 from rupato-deriv/Rupato/Fix--oidc-account-list
Browse files Browse the repository at this point in the history
fix: oidc check
  • Loading branch information
rupato-deriv authored Feb 18, 2025
2 parents 8116530 + 72f4a04 commit a868155
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ const Layout = () => {
const isLoggedInCookie = Cookies.get('logged_state') === 'true';
const isEndpointPage = window.location.pathname.includes('endpoint');
const checkClientAccount = JSON.parse(localStorage.getItem('clientAccounts') ?? '{}');
const checkAccountList = JSON.parse(localStorage.getItem('accountList') ?? '{}');
const checkAccountList = api_base?.account_info?.account_list ?? {};
const areAccountsEqual = Object.keys(checkClientAccount).length === Object.keys(checkAccountList).length;

console.log('clientAccounts', { checkClientAccount, checkAccountList, api_base });
console.log('clientAccounts', {
checkClientAccount,
checkAccountList,
account_list: api_base?.account_info?.account_list,
areAccountsEqual,
});

useEffect(() => {
if (isLoggedInCookie && isOAuth2Enabled && !isEndpointPage && !isCallbackPage) {
Expand Down

0 comments on commit a868155

Please sign in to comment.