Allow superadmin to bypass onboarding billing
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-25 00:05:34 +01:00
parent c4ac38e41a
commit 78bd3c9267
6 changed files with 76 additions and 1 deletions

View File

@@ -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') {