* Allow Super Admin to view tables using RLS * Replace previous usages of the Admin client using the authed client using the new RLS * Enforce MFA for Super Admin users * Enforce RLS when user opted in to MFA. * Add Super Admin Access Policies and Update Database Types * Consolidate super admin logic into a single function that uses the RPC is_super_admin * Added Super Admin E2E tests * Fixes and improvements * Bump version to 2.5.0
49 lines
1.6 KiB
TypeScript
49 lines
1.6 KiB
TypeScript
import { EnvMode } from '@/app/variables/lib/types';
|
|
import { EnvModeSelector } from '@/components/env-mode-selector';
|
|
import { ServiceCard } from '@/components/status-tile';
|
|
|
|
import { Page, PageBody, PageHeader } from '@kit/ui/page';
|
|
|
|
import { createConnectivityService } from './lib/connectivity-service';
|
|
|
|
type DashboardPageProps = React.PropsWithChildren<{
|
|
searchParams: Promise<{ mode?: EnvMode }>;
|
|
}>;
|
|
|
|
export default async function DashboardPage(props: DashboardPageProps) {
|
|
const mode = (await props.searchParams).mode ?? 'development';
|
|
const connectivityService = createConnectivityService(mode);
|
|
|
|
const [
|
|
supabaseStatus,
|
|
supabaseAdminStatus,
|
|
stripeStatus,
|
|
stripeWebhookStatus,
|
|
] = await Promise.all([
|
|
connectivityService.checkSupabaseConnectivity(),
|
|
connectivityService.checkSupabaseAdminConnectivity(),
|
|
connectivityService.checkStripeConnected(),
|
|
connectivityService.checkStripeWebhookEndpoints(),
|
|
]);
|
|
|
|
return (
|
|
<Page style={'custom'}>
|
|
<PageHeader
|
|
displaySidebarTrigger={false}
|
|
description={'Check the status of your Supabase and Stripe services'}
|
|
>
|
|
<EnvModeSelector mode={mode} />
|
|
</PageHeader>
|
|
|
|
<PageBody className={'py-2'}>
|
|
<div className="grid grid-cols-1 gap-4 md:grid-cols-4">
|
|
<ServiceCard name={'Supabase API'} status={supabaseStatus} />
|
|
<ServiceCard name={'Supabase Admin'} status={supabaseAdminStatus} />
|
|
<ServiceCard name={'Stripe API'} status={stripeStatus} />
|
|
<ServiceCard name={'Stripe Webhook'} status={stripeWebhookStatus} />
|
|
</div>
|
|
</PageBody>
|
|
</Page>
|
|
);
|
|
}
|