From 0373f2055b3f9b590659302bbcbdb8d7bf1a23d9 Mon Sep 17 00:00:00 2001 From: Adrienne Rio Date: Tue, 31 Dec 2024 11:48:26 +0800 Subject: [PATCH] chore: removed unrelated changes --- src/hooks/useOAuth2.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/hooks/useOAuth2.ts b/src/hooks/useOAuth2.ts index 40d21c6..eb63337 100644 --- a/src/hooks/useOAuth2.ts +++ b/src/hooks/useOAuth2.ts @@ -27,11 +27,7 @@ const LOGOUT_TIMEOUT = 10000; * @returns {{ OAuth2Logout: () => Promise }} - Object containing the OAuth2Logout function. * @deprecated Please use OAuth2Logout function instead of this hook from the `@deriv-com/auth-client` package. */ -export const useOAuth2 = ( - OAuth2GrowthBookConfig: OAuth2GBConfig, - WSLogoutAndRedirect: () => Promise, - isGBLoaded?: boolean -) => { +export const useOAuth2 = (OAuth2GrowthBookConfig: OAuth2GBConfig, WSLogoutAndRedirect: () => Promise) => { const { OAuth2EnabledApps, OAuth2EnabledAppsInitialised } = OAuth2GrowthBookConfig; const isOAuth2Enabled = useIsOAuth2Enabled(OAuth2EnabledApps, OAuth2EnabledAppsInitialised); @@ -45,14 +41,13 @@ export const useOAuth2 = ( }; const OAuth2Logout = useCallback(async () => { - if (!isGBLoaded) return if (!isOAuth2Enabled) return WSLogoutAndRedirect(); const onMessage = (event: MessageEvent) => { if (event.data === 'logout_complete') { const domains = ['deriv.com', 'binary.sx', 'pages.dev', 'localhost']; const currentDomain = window.location.hostname.split('.').slice(-2).join('.'); - if (domains.includes(currentDomain) && isOAuth2Enabled) { + if (domains.includes(currentDomain)) { Cookies.set('logged_state', 'false', { expires: 30, path: '/',