mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-21 20:21:10 +10:00
partial: user routes
This commit is contained in:
@ -1,16 +1,15 @@
|
||||
import aclManager from "~/server/internal/acls";
|
||||
import clientHandler from "~/server/internal/clients/handler";
|
||||
|
||||
/**
|
||||
* Revoke client
|
||||
* @param id Client ID
|
||||
*/
|
||||
export default defineEventHandler(async (h3) => {
|
||||
const userId = await aclManager.getUserIdACL(h3, ["clients:revoke"]);
|
||||
if (!userId) throw createError({ statusCode: 403 });
|
||||
|
||||
const clientId = getRouterParam(h3, "id");
|
||||
if (!clientId)
|
||||
throw createError({
|
||||
statusCode: 400,
|
||||
statusMessage: "Client ID missing in route params",
|
||||
});
|
||||
const clientId = getRouterParam(h3, "id")!;
|
||||
|
||||
await clientHandler.removeClient(clientId);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user