aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/src')
-rw-r--r--packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js14
1 files changed, 9 insertions, 5 deletions
diff --git a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
index f81247d..85fe53c 100644
--- a/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
+++ b/packages/meshbay-hub/src/meshbay_hub/static/create-group-page.js
@@ -142,11 +142,15 @@ function CreateGroupWizard({ token, username, onCreated, allowPublicGroups = tru
const linkNodeKey = useCallback(async (pk) => {
if (!pk) return;
- try {
- await hubFetch('/v1/users/me/node_key', {
- method: 'PUT', token, body: { pk_node_ed25519: pk },
- });
- } catch { /* already linked or same key */ }
+ // `PUT /me/node_key` is idempotent — linking the same key again returns 200,
+ // so there is no "already linked" case to swallow here. A failure means the
+ // hub did not record this node's key (a rejected session, a malformed key),
+ // and the node then fails to authenticate and never comes up. It must
+ // surface — `detectNode`'s catch shows it — rather than let the wizard
+ // proceed against a node that looks linked but is not.
+ await hubFetch('/v1/users/me/node_key', {
+ method: 'PUT', token, body: { pk_node_ed25519: pk },
+ });
}, [token]);
const detectNode = useCallback(async () => {