Browse Source

Fix: don't expect dump to contain client

Fixes: #2200
Fixes Bug introduced in: #2058
pull/2205/head
Bernd Storath 2 weeks ago
parent
commit
529d65b3fb
  1. 9
      src/server/api/client/[clientId]/index.get.ts

9
src/server/api/client/[clientId]/index.get.ts

@ -19,17 +19,12 @@ export default definePermissionEventHandler(
});
}
// data can be undefined if the client is disabled
const data = await WireGuard.dumpByPublicKey(result.publicKey);
if (!data) {
throw createError({
statusCode: 500,
statusMessage: 'Failed to dump client data',
});
}
return {
...result,
endpoint: data.endpoint,
endpoint: data?.endpoint,
};
}
);

Loading…
Cancel
Save