Eliminated all references to `isSSOEnabled` across the frontend, backend, and configuration files. This change simplifies the codebase by removing unnecessary feature flag checks, associated logic, and environment variables. The SSO feature remains available without reliance on this flag.
39 lines
1.2 KiB
TypeScript
39 lines
1.2 KiB
TypeScript
import { useCreateAppRouter } from '@/app/hooks/useCreateAppRouter';
|
|
import { currentUserState } from '@/auth/states/currentUserState';
|
|
import { billingState } from '@/client-config/states/billingState';
|
|
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
|
|
import { RouterProvider } from 'react-router-dom';
|
|
import { useRecoilValue } from 'recoil';
|
|
import { FeatureFlagKey } from '~/generated/graphql';
|
|
|
|
export const AppRouter = () => {
|
|
const billing = useRecoilValue(billingState);
|
|
const isFreeAccessEnabled = useIsFeatureEnabled(
|
|
FeatureFlagKey.IsFreeAccessEnabled,
|
|
);
|
|
const isCRMMigrationEnabled = useIsFeatureEnabled(
|
|
FeatureFlagKey.IsCrmMigrationEnabled,
|
|
);
|
|
const isServerlessFunctionSettingsEnabled = useIsFeatureEnabled(
|
|
FeatureFlagKey.IsFunctionSettingsEnabled,
|
|
);
|
|
|
|
const isBillingPageEnabled =
|
|
billing?.isBillingEnabled && !isFreeAccessEnabled;
|
|
|
|
const currentUser = useRecoilValue(currentUserState);
|
|
|
|
const isAdminPageEnabled = currentUser?.canImpersonate;
|
|
|
|
return (
|
|
<RouterProvider
|
|
router={useCreateAppRouter(
|
|
isBillingPageEnabled,
|
|
isCRMMigrationEnabled,
|
|
isServerlessFunctionSettingsEnabled,
|
|
isAdminPageEnabled,
|
|
)}
|
|
/>
|
|
);
|
|
};
|