Skip to content

Commit

Permalink
Adrienne / Fix race condition issue with Growthbook and OIDC (#17894)
Browse files Browse the repository at this point in the history
* fix: race condition issue with growthbook values

* chore: commented out sso and slo temporarirly for deriv app

* chore: add todo
  • Loading branch information
adrienne-deriv authored Dec 24, 2024
1 parent 8fd853a commit 1dadda1
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions packages/core/src/App/AppContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,12 @@ const AppContent: React.FC<{ passthrough: unknown }> = observer(({ passthrough }
const { isMobile } = useDevice();
const { switchLanguage } = useTranslations();

const { isOAuth2Enabled, oAuthLogout } = useOauth2({
const { isOAuth2Enabled } = useOauth2({
handleLogout: async () => {
await logout();
},
});

useSilentLoginAndLogout({
is_client_store_initialized,
isOAuth2Enabled,
oAuthLogout,
});

const [isWebPasskeysFFEnabled, isGBLoaded] = useGrowthbookIsOn({
featureFlag: 'web_passkeys',
});
Expand All @@ -81,6 +75,17 @@ const AppContent: React.FC<{ passthrough: unknown }> = observer(({ passthrough }
const [isCountryCodeDropdownEnabled, isCountryCodeDropdownGBLoaded] = useGrowthbookGetFeatureValue({
featureFlag: 'enable_country_code_dropdown',
});

// NOTE: Commented this out for now due to single logout causing Deriv.app to be logged out continously
// There is a case where if logged_state is false coming from other platforms, Deriv app will SLO the user out
// TODO: Revert this once OIDC is enabled back for Deriv.app
// useSilentLoginAndLogout({
// is_client_store_initialized,
// isOAuth2Enabled,
// oAuthLogout,
// isGBLoaded,
// });

const { data } = useRemoteConfig(true);
const { tracking_datadog } = data;
const is_passkeys_supported = browserSupportsWebAuthn();
Expand Down

0 comments on commit 1dadda1

Please sign in to comment.