fix: use correct /api/auth/me endpoint for coffee page user detection

This commit is contained in:
2026-07-03 00:23:04 -05:00
parent 60afc2349e
commit bfc627f451
+7 -2
View File
@@ -54,8 +54,13 @@ export default function CoffeePage() {
if (!res.ok) throw new Error('Failed to load menu');
return res.json();
}),
fetch('/api/auth/session').then(async (res) => {
if (res.ok) return res.json();
fetch('/api/auth/me').then(async (res) => {
if (res.ok) {
const data = await res.json();
if (data.authenticated && data.id) {
return { user: { id: data.id, username: data.username, role: data.role, first_name: data.first_name, last_name: data.last_name } };
}
}
return { user: null };
}),
fetch('/api/rooms').then(async (res) => {