refactor(tokens): async DB-touching methods; the auth token handlers await them

This commit is contained in:
jubnl
2026-09-22 01:21:29 +02:00
parent 4700bb38a5
commit fc49c0c768
12 changed files with 242 additions and 241 deletions
+2 -2
View File
@@ -306,11 +306,11 @@ export class AdminController {
// ── MCP tokens / OAuth sessions ──
@Get('mcp-tokens')
listMcpTokens() { return { tokens: this.tokens.listAllMcpTokens() }; }
async listMcpTokens() { return { tokens: await this.tokens.listAllMcpTokens() }; }
@Delete('mcp-tokens/:id')
async deleteMcpToken(@CurrentUser() user: User, @Param('id') id: string, @Req() req: Request) {
ok(this.tokens.adminDeleteMcpToken(id));
ok(await this.tokens.adminDeleteMcpToken(id));
await this.audit.writeAudit({ userId: user.id, action: 'admin.mcp_token_delete', resource: String(id), ip: getClientIp(req) });
return { success: true };
}