Skip to content

Commit 07694b4

Browse files
Error handling missing auth cookie
Now correctly handles missing auth cookie with new detection logic, and requests read JTI token for room listings. This should close remaining edge cases where auth fails for any given reason other than services being hard down or unreachable.
1 parent 82dc624 commit 07694b4

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

data/src/emulator.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9532,6 +9532,18 @@ class EmulatorJS {
95329532
"&game_id=" +
95339533
this.config.gameId
95349534
);
9535+
9536+
// Check for HTTP error status codes (like 503)
9537+
if (!response.ok) {
9538+
console.log(`Room list fetch failed with status ${response.status}`);
9539+
// Trigger token refresh for auth errors
9540+
if (window.handleSfuAuthError) {
9541+
console.log("HTTP error detected, attempting token refresh...");
9542+
window.handleSfuAuthError("read");
9543+
}
9544+
return {};
9545+
}
9546+
95359547
const data = await response.text();
95369548
console.log("Fetched open rooms:", data);
95379549
const parsed = JSON.parse(data);

emulator.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)