Add auth checks for user routes and dashboard state
Some checks failed
Deploy to Production / test (push) Failing after 33s

- tighten route authorization and schema handling
- update user route tests and server coverage
- refresh player dashboard behavior
This commit is contained in:
syntaxbullet
2026-04-09 20:42:32 +02:00
parent bdfe0d1594
commit 8369d10bab
20 changed files with 471 additions and 66 deletions

View File

@@ -30,7 +30,7 @@ export default function PlayerDashboard({ userId }: { userId: string }) {
useEffect(() => {
async function load() {
try {
const userData = await get<UserData>(`/api/users/${userId}`);
const userData = await get<UserData>("/api/me");
setUser(userData);
} catch {
setError("Failed to load profile");
@@ -39,7 +39,7 @@ export default function PlayerDashboard({ userId }: { userId: string }) {
}
try {
const data = await get<{ inventory: InventoryEntry[] }>(`/api/users/${userId}/inventory`);
const data = await get<{ inventory: InventoryEntry[] }>("/api/me/inventory");
setInventory(data.inventory ?? []);
} catch {
setInventoryError(true);