diff options
Diffstat (limited to 'packages/meshbay-node/src/meshbay_node/ops.py')
| -rw-r--r-- | packages/meshbay-node/src/meshbay_node/ops.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/meshbay-node/src/meshbay_node/ops.py b/packages/meshbay-node/src/meshbay_node/ops.py index 07579cd..cd5dc32 100644 --- a/packages/meshbay-node/src/meshbay_node/ops.py +++ b/packages/meshbay-node/src/meshbay_node/ops.py @@ -219,6 +219,16 @@ async def unpin_member(state: dict, user_id: str) -> dict: roster = _roster(state) if not await roster.unpin(user_id): raise OpError("No such pinned identity", status=404) + # Drop the stored keypair bundle too. Left behind, it is served to the next + # connection, which then cannot open it (the passphrase may have changed + # since) and dies in the identity step before it ever reaches the join the + # unpin was meant to enable. + bundle_store = state.get("bundle_store") + if bundle_store: + try: + await bundle_store.delete_keypair(user_id) + except Exception: + log.warning("unpin: could not drop keypair bundle for %s", user_id[:8]) log.info("Identity unpinned: user=%s", user_id[:8]) return {"status": "unpinned", "user_id": user_id} |