fix: prod ready websockets

This commit is contained in:
2026-01-03 17:55:45 +00:00
parent 5b504d10bd
commit 2cd1d53616
7 changed files with 12 additions and 5 deletions
+4 -1
View File
@@ -90,8 +90,11 @@ async function saveGameResult(gameId, result, token) {
payload.winner_user_id = result.winnerId;
payload.loser_user_id = result.loserId;
}
const authHeader = token.startsWith("Bearer ") ? token : `Bearer ${token}`;
await axios.put(`${API_URL}/games/${gameId}`, payload, {
headers: { Authorization: token },
headers: { Authorization: authHeader },
});
} catch (error) {
console.error(`[DB Error] Game ${gameId}:`, error.message);