Skip to content

Commit

Permalink
fix: oidc check
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Feb 18, 2025
1 parent a868155 commit d066ffd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { useEffect } from 'react';
import clsx from 'clsx';
import Cookies from 'js-cookie';
import { Outlet } from 'react-router-dom';
import { api_base } from '@/external/bot-skeleton';
import { useOauth2 } from '@/hooks/auth/useOauth2';
import { requestOidcAuthentication } from '@deriv-com/auth-client';
import { useDevice } from '@deriv-com/ui';
Expand All @@ -20,13 +19,12 @@ 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 = api_base?.account_info?.account_list ?? {};
const checkAccountList = JSON.parse(localStorage.getItem('api_account_list') ?? '{}');
const areAccountsEqual = Object.keys(checkClientAccount).length === Object.keys(checkAccountList).length;

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

Expand Down
1 change: 1 addition & 0 deletions src/external/bot-skeleton/services/api/api-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class APIBase {
this.is_authorized = true;
this.subscribe();
this.getSelfExclusion();
localStorage.setItem('api_account_list', JSON.stringify(authorize.account_list));
} catch (e) {
this.is_authorized = false;
setIsAuthorized(false);
Expand Down

0 comments on commit d066ffd

Please sign in to comment.