Feat: show client endpoint (#2058)

* show client endpoint

* improve

* fix status code
This commit is contained in:
Bernd Storath
2025-07-25 12:00:42 +02:00
committed by GitHub
parent b5318086d2
commit 07f89d15a9
5 changed files with 54 additions and 2 deletions
+13 -1
View File
@@ -18,6 +18,18 @@ export default definePermissionEventHandler(
statusMessage: 'Client not found',
});
}
return result;
const data = await WireGuard.dumpByPublicKey(result.publicKey);
if (!data) {
throw createError({
statusCode: 500,
statusMessage: 'Failed to dump client data',
});
}
return {
...result,
endpoint: data.endpoint,
};
}
);