summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/transport.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/transport.js b/packages/meshbay-hub/src/meshbay_hub/static/transport.js
index 35f729e..9f85ee1 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/transport.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/transport.js
@@ -305,6 +305,15 @@ class MeshBayTransport {
// "failed" — see the pc.onconnectionstatechange handler further down.
this._connectArgs = { nodeId, groupId, gekRaw, bundleKey, username, userId, joinCode };
this._lastToken = jwtToken;
+ // The constructor sets this once from whatever token the caller had at
+ // the time — and the signaling POST below reads *this*, not `jwtToken`.
+ // A reconnect passes a freshly-fetched `jwtToken` (see onNeedToken) but
+ // that never reached here before, so the signaling call kept using the
+ // original token no matter how many minutes had passed or how many
+ // reconnect attempts fetched a new one — confirmed live: every attempt
+ // failed "Signaling failed: 401 Invalid or expired token" in a loop,
+ // never actually trying the fresh token connect() had just been handed.
+ this._accessToken = jwtToken;
this._gekRaw = gekRaw || null;
this._sessionKeys = sessionKeys || null;
this._bundleKey = bundleKey || null;