Skip to content

Commit d066ffd

Browse files
committed
fix: oidc check
1 parent a868155 commit d066ffd

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/components/layout/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useEffect } from 'react';
22
import clsx from 'clsx';
33
import Cookies from 'js-cookie';
44
import { Outlet } from 'react-router-dom';
5-
import { api_base } from '@/external/bot-skeleton';
65
import { useOauth2 } from '@/hooks/auth/useOauth2';
76
import { requestOidcAuthentication } from '@deriv-com/auth-client';
87
import { useDevice } from '@deriv-com/ui';
@@ -20,13 +19,12 @@ const Layout = () => {
2019
const isLoggedInCookie = Cookies.get('logged_state') === 'true';
2120
const isEndpointPage = window.location.pathname.includes('endpoint');
2221
const checkClientAccount = JSON.parse(localStorage.getItem('clientAccounts') ?? '{}');
23-
const checkAccountList = api_base?.account_info?.account_list ?? {};
22+
const checkAccountList = JSON.parse(localStorage.getItem('api_account_list') ?? '{}');
2423
const areAccountsEqual = Object.keys(checkClientAccount).length === Object.keys(checkAccountList).length;
2524

2625
console.log('clientAccounts', {
2726
checkClientAccount,
2827
checkAccountList,
29-
account_list: api_base?.account_info?.account_list,
3028
areAccountsEqual,
3129
});
3230

src/external/bot-skeleton/services/api/api-base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class APIBase {
177177
this.is_authorized = true;
178178
this.subscribe();
179179
this.getSelfExclusion();
180+
localStorage.setItem('api_account_list', JSON.stringify(authorize.account_list));
180181
} catch (e) {
181182
this.is_authorized = false;
182183
setIsAuthorized(false);

0 commit comments

Comments
 (0)