From 6af68e76de3657d837875b1c9d0f5c9678429e59 Mon Sep 17 00:00:00 2001 From: Jarvis Date: Mon, 13 Jul 2026 03:11:54 -0500 Subject: [PATCH] fix(discord): authorize stop actions explicitly --- apps/gateway/src/chat/chat.gateway.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/gateway/src/chat/chat.gateway.ts b/apps/gateway/src/chat/chat.gateway.ts index 9e5cd29..edacf2d 100644 --- a/apps/gateway/src/chat/chat.gateway.ts +++ b/apps/gateway/src/chat/chat.gateway.ts @@ -688,7 +688,7 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa @MessageBody() envelope: DiscordIngressEnvelope, ): Promise { if (!client.data.discordService) return; - const ingress = this.resolveDiscordIngress(client, envelope, 'approve'); + const ingress = this.resolveDiscordIngress(client, envelope, 'stop'); const actionParts = ingress?.content.match(/^\/stop\s+([^\s]+)\s+([^\s]+)\s+([^\s]+)$/i); const serviceUserId = process.env['DISCORD_SERVICE_USER_ID']; if (!ingress || !actionParts || !serviceUserId || !this.runtimeRegistry) return; @@ -697,7 +697,7 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa ingress.guildId, ingress.channelId, ingress.userId, - 'approve', + 'stop', ); if (!binding) return; @@ -721,7 +721,7 @@ export class ChatGateway implements OnGatewayInit, OnGatewayConnection, OnGatewa private resolveDiscordIngress( client: Socket, envelope: DiscordIngressEnvelope, - operation: 'send' | 'approve' = 'send', + operation: 'send' | 'approve' | 'stop' = 'send', ): DiscordIngressPayload | null { const payload = verifyDiscordIngressEnvelope( envelope,