fix: add missing i18n translation key and admin debug logs
- Added common.all translation key to de.ts and en.ts - Added debug logging to admin page for troubleshooting access issues
This commit is contained in:
@@ -9,15 +9,23 @@ export default async function AdminPage() {
|
|||||||
const supabase = createServerComponentClient({ cookies });
|
const supabase = createServerComponentClient({ cookies });
|
||||||
const { data: { user } } = await supabase.auth.getUser();
|
const { data: { user } } = await supabase.auth.getUser();
|
||||||
|
|
||||||
|
console.log('[Admin Page] User:', user?.id, user?.email);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
console.log('[Admin Page] No user found, redirecting to home');
|
||||||
redirect('/');
|
redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
const isAdmin = await checkIsAdmin(user.id);
|
const isAdmin = await checkIsAdmin(user.id);
|
||||||
|
console.log('[Admin Page] Is admin check result:', isAdmin);
|
||||||
|
|
||||||
if (!isAdmin) {
|
if (!isAdmin) {
|
||||||
|
console.log('[Admin Page] User is not admin, redirecting to home');
|
||||||
redirect('/');
|
redirect('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.log('[Admin Page] Access granted, loading dashboard');
|
||||||
|
|
||||||
// Fetch global API stats
|
// Fetch global API stats
|
||||||
const stats = await getGlobalApiStats();
|
const stats = await getGlobalApiStats();
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const de: TranslationKeys = {
|
|||||||
check: 'Prüfen',
|
check: 'Prüfen',
|
||||||
link: 'Verknüpfen',
|
link: 'Verknüpfen',
|
||||||
none: 'Keine',
|
none: 'Keine',
|
||||||
|
all: 'Alle',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
title: 'Whisky Vault',
|
title: 'Whisky Vault',
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const en: TranslationKeys = {
|
|||||||
check: 'Check',
|
check: 'Check',
|
||||||
link: 'Link',
|
link: 'Link',
|
||||||
none: 'None',
|
none: 'None',
|
||||||
|
all: 'All',
|
||||||
},
|
},
|
||||||
home: {
|
home: {
|
||||||
title: 'Whisky Vault',
|
title: 'Whisky Vault',
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ export type TranslationKeys = {
|
|||||||
check: string;
|
check: string;
|
||||||
link: string;
|
link: string;
|
||||||
none: string;
|
none: string;
|
||||||
|
all: string;
|
||||||
};
|
};
|
||||||
home: {
|
home: {
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user