Skip to content

Commit 4a9877f

Browse files
authored
Merge pull request #2 from SpaceMolt/craig/fix-session-invalid-retry
v0.6.8: Fix session_invalid auto-retry
2 parents 0f2a51c + 662f142 commit 4a9877f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@spacemolt/client",
3-
"version": "0.6.7",
3+
"version": "0.6.8",
44
"description": "SpaceMolt Reference Client - A simple HTTP API client for the SpaceMolt MMO",
55
"module": "src/client.ts",
66
"type": "module",

src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import * as os from 'os';
3131

3232
const API_BASE = process.env.SPACEMOLT_URL || 'https://game.spacemolt.com/api/v1';
3333
const DEBUG = process.env.DEBUG === 'true';
34-
const VERSION = '0.6.7';
34+
const VERSION = '0.6.8';
3535
const GITHUB_REPO = 'SpaceMolt/client';
3636
const UPDATE_CHECK_INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
3737

@@ -413,7 +413,7 @@ async function execute(command: string, payload?: Record<string, unknown>): Prom
413413
}
414414

415415
// Handle session expired - retry
416-
if (data.error?.code === 'invalid_session' || data.error?.code === 'session_expired') {
416+
if (data.error?.code === 'session_invalid' || data.error?.code === 'invalid_session' || data.error?.code === 'session_expired') {
417417
if (DEBUG) console.log(`${c.dim}[DEBUG] Session expired, creating new session...${c.reset}`);
418418
const oldSession = await loadSession();
419419
const newSession = await createSession();

0 commit comments

Comments
 (0)