summaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src/meshbay_hub/static/transport.js
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src/meshbay_hub/static/transport.js')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/transport.js15
1 files changed, 15 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 c86d668..a07f431 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/transport.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/transport.js
@@ -1178,6 +1178,21 @@ class MeshBayTransport {
} catch (e) {
// The UI turns this into "ask the operator for an invite code".
this._joinError = e;
+ // Asked for by the page ("Get a linking code"): filed on this same
+ // connection, still before the proof (MNP 6.3), because the page
+ // closes a connection that did not finish. Only for an identity the
+ // application keeps: one a browser minted is gone by its next
+ // connection, and approving it would link nothing.
+ if (e.reason === 'unknown_device' && this.fileDeviceRequest
+ && this._identity.native) {
+ try {
+ const filed = await this.requestDeviceAdd(userId);
+ e.deviceCode = filed.code;
+ e.deviceExpiresAt = filed.expiresAt;
+ } catch (fe) {
+ e.message = fe.message;
+ }
+ }
}
}