MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / revoke

Method revoke

apps/web/services/api-keys.ts:51–61  ·  view source on GitHub ↗
({ id, accountId }: { id: string; accountId: string })

Source from the content-addressed store, hash-verified

49 }
50
51 static async revoke({ id, accountId }: { id: string; accountId: string }) {
52 const apiKey = await prisma.apiKeys.findUnique({ where: { id } });
53 if (!apiKey) {
54 return { ok: false, data: 'not_found' };
55 }
56 if (apiKey.accountId !== accountId) {
57 return { ok: false, data: 'account_mismatch' };
58 }
59 await prisma.apiKeys.delete({ where: { id: apiKey.id } });
60 return { ok: true };
61 }
62}

Callers 2

api-keys.test.tsFile · 0.80
api-keys.tsFile · 0.80

Calls 1

deleteMethod · 0.45

Tested by

no test coverage detected