ROOT CAUSE FIX: All server-side Supabase clients (server-client, middleware-client, server-admin-client) now use SUPABASE_INTERNAL_URL (http://supabase-kong:8000) when available, with cookieOptions.name set to match the external URL's cookie key (e.g. sb-myeasycms-auth-token). This gives us: - Reliable Docker-internal networking (no hairpin NAT through Traefik) - Correct session cookie matching between browser and server - No more 500 errors on SSR pages that query Supabase Reverted per-page try/catch workarounds since root cause is now fixed.
44 lines
1.3 KiB
TypeScript
44 lines
1.3 KiB
TypeScript
import { getSupabaseServerClient } from '@kit/supabase/server-client';
|
|
import { createMeetingsApi } from '@kit/sitzungsprotokolle/api';
|
|
import { MeetingsTabNavigation, MeetingsDashboard } from '@kit/sitzungsprotokolle/components';
|
|
|
|
import { CmsPageShell } from '~/components/cms-page-shell';
|
|
import { AccountNotFound } from '~/components/account-not-found';
|
|
|
|
interface PageProps {
|
|
params: Promise<{ account: string }>;
|
|
}
|
|
|
|
export default async function MeetingsPage({ params }: PageProps) {
|
|
const { account } = await params;
|
|
const client = getSupabaseServerClient();
|
|
|
|
const { data: acct } = await client
|
|
.from('accounts')
|
|
.select('id')
|
|
.eq('slug', account)
|
|
.single();
|
|
|
|
if (!acct) return <AccountNotFound />;
|
|
|
|
const api = createMeetingsApi(client);
|
|
|
|
const [stats, recentProtocols, overdueTasks] = await Promise.all([
|
|
api.getDashboardStats(acct.id),
|
|
api.getRecentProtocols(acct.id),
|
|
api.getOverdueTasks(acct.id),
|
|
]);
|
|
|
|
return (
|
|
<CmsPageShell account={account} title="Sitzungsprotokolle">
|
|
<MeetingsTabNavigation account={account} activeTab="overview" />
|
|
<MeetingsDashboard
|
|
stats={stats}
|
|
recentProtocols={recentProtocols}
|
|
overdueTasks={overdueTasks}
|
|
account={account}
|
|
/>
|
|
</CmsPageShell>
|
|
);
|
|
}
|