diff --git a/src/app/admin/page.tsx b/src/app/admin/page.tsx index 7d467fc..e015c7b 100644 --- a/src/app/admin/page.tsx +++ b/src/app/admin/page.tsx @@ -9,15 +9,23 @@ export default async function AdminPage() { const supabase = createServerComponentClient({ cookies }); const { data: { user } } = await supabase.auth.getUser(); + console.log('[Admin Page] User:', user?.id, user?.email); + if (!user) { + console.log('[Admin Page] No user found, redirecting to home'); redirect('/'); } const isAdmin = await checkIsAdmin(user.id); + console.log('[Admin Page] Is admin check result:', isAdmin); + if (!isAdmin) { + console.log('[Admin Page] User is not admin, redirecting to home'); redirect('/'); } + console.log('[Admin Page] Access granted, loading dashboard'); + // Fetch global API stats const stats = await getGlobalApiStats(); @@ -185,16 +193,16 @@ export default async function AdminPage() { {item.api_type === 'google_search' ? 'Search' : 'AI'} {item.success ? 'Success' : 'Failed'} diff --git a/src/i18n/de.ts b/src/i18n/de.ts index e9338a1..501f142 100644 --- a/src/i18n/de.ts +++ b/src/i18n/de.ts @@ -15,6 +15,7 @@ export const de: TranslationKeys = { check: 'Prüfen', link: 'Verknüpfen', none: 'Keine', + all: 'Alle', }, home: { title: 'Whisky Vault', diff --git a/src/i18n/en.ts b/src/i18n/en.ts index 804a287..cfdff77 100644 --- a/src/i18n/en.ts +++ b/src/i18n/en.ts @@ -15,6 +15,7 @@ export const en: TranslationKeys = { check: 'Check', link: 'Link', none: 'None', + all: 'All', }, home: { title: 'Whisky Vault', diff --git a/src/i18n/types.ts b/src/i18n/types.ts index 5b18470..e85c504 100644 --- a/src/i18n/types.ts +++ b/src/i18n/types.ts @@ -13,6 +13,7 @@ export type TranslationKeys = { check: string; link: string; none: string; + all: string; }; home: { title: string;