Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/javascript/src/models/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,10 @@ export interface ThemePreferences {
*/
direction?: 'ltr' | 'rtl';
/**
* Inherit from Branding from WSO2 Identity Server or Asgardeo.
* Inherit branding from WSO2 Identity Server or Asgardeo.
* When set to `true`, the SDK will fetch and apply branding preferences from the server.
* Defaults to `false` — branding is not fetched unless explicitly enabled.
* @default false
*/
inheritFromBranding?: boolean;
/**
Expand Down
6 changes: 3 additions & 3 deletions packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
return;
}

// Enable branding by default or when explicitly enabled
const shouldFetchBranding: boolean = preferences?.theme?.inheritFromBranding !== false;
// Only fetch branding when explicitly enabled via preferences.theme.inheritFromBranding
const shouldFetchBranding: boolean = preferences?.theme?.inheritFromBranding === true;

if (shouldFetchBranding && isInitializedSync && baseUrl && !hasFetchedBranding && !isBrandingLoading) {
fetchBranding();
Expand Down Expand Up @@ -635,7 +635,7 @@ const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
brandingPreference={brandingPreference}
isLoading={isBrandingLoading}
error={brandingError}
enabled={preferences?.theme?.inheritFromBranding !== false}
enabled={preferences?.theme?.inheritFromBranding === true}
refetch={refetchBranding}
>
<ThemeProvider
Expand Down
Loading