try to fix issues with logging in on linux

This commit is contained in:
2026-05-06 11:35:04 +02:00
parent ad882a1e19
commit 524a46f583
+5 -6
View File
@@ -232,16 +232,15 @@ document.addEventListener("DOMContentLoaded", async () => {
} }
}; };
try { currentUsername = await getUsernameFromToken();
await connectSocket();
currentUsername = currentUsername || await getUsernameFromToken();
if (!currentUsername) { if (!currentUsername) {
showJoinError("User not authenticated."); showJoinError("User not authenticated.");
} }
} catch (error) {
console.error("Home authentication failed:", error); connectSocket().catch((error) => {
console.error("Home WebSocket connection failed:", error);
showJoinError("Real-time poker connection failed."); showJoinError("Real-time poker connection failed.");
} });
try { try {
const balanceRes = await fetch("/balance", { const balanceRes = await fetch("/balance", {