mirror of
https://github.com/wg-easy/wg-easy.git
synced 2025-10-11 18:40:35 +08:00
Fix: don't expect dump to contain client
Fixes: #2200 Fixes Bug introduced in: #2058
This commit is contained in:
@@ -19,17 +19,12 @@ export default definePermissionEventHandler(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// data can be undefined if the client is disabled
|
||||||
const data = await WireGuard.dumpByPublicKey(result.publicKey);
|
const data = await WireGuard.dumpByPublicKey(result.publicKey);
|
||||||
if (!data) {
|
|
||||||
throw createError({
|
|
||||||
statusCode: 500,
|
|
||||||
statusMessage: 'Failed to dump client data',
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...result,
|
...result,
|
||||||
endpoint: data.endpoint,
|
endpoint: data?.endpoint,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user