Allow superadmin to bypass onboarding billing
This commit is contained in:
@@ -61,8 +61,15 @@ function RequireAuth() {
|
||||
const isWelcomePath = location.pathname.startsWith(ADMIN_WELCOME_BASE_PATH);
|
||||
const isBillingPath = location.pathname.startsWith(ADMIN_BILLING_PATH);
|
||||
const isTenantAdmin = Boolean(user && user.role !== 'member');
|
||||
const isSuperAdmin = user?.role === 'super_admin' || user?.role === 'superadmin';
|
||||
const shouldCheckPackages =
|
||||
status === 'authenticated' && isTenantAdmin && !eventsLoading && !hasEvents && !isWelcomePath && !isBillingPath;
|
||||
status === 'authenticated'
|
||||
&& isTenantAdmin
|
||||
&& !isSuperAdmin
|
||||
&& !eventsLoading
|
||||
&& !hasEvents
|
||||
&& !isWelcomePath
|
||||
&& !isBillingPath;
|
||||
|
||||
const { data: packagesData, isLoading: packagesLoading } = useQuery({
|
||||
queryKey: ['mobile', 'onboarding', 'packages-overview'],
|
||||
@@ -93,6 +100,7 @@ function RequireAuth() {
|
||||
isBillingPath,
|
||||
isOnboardingDismissed,
|
||||
isOnboardingCompleted,
|
||||
isSuperAdmin,
|
||||
});
|
||||
|
||||
if (status === 'loading') {
|
||||
|
||||
Reference in New Issue
Block a user