Skip to content

Commit 7352fe5

Browse files
refactor: new auth decorator
1 parent d721e52 commit 7352fe5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/chat-bot/chat-bot.controller.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
import { Controller, Post, Req, Res } from "@nestjs/common";
22
import { ChatbotService } from "./chat-bot.service";
33
import type { Request, Response } from "express";
4-
import { M2MOrAbilities } from "../auth/decorators/m2m-or-abilities.decorator";
5-
import { INTEGRATION_ABILITY } from "../auth/ability/abilities.constants";
4+
import { AdminOnly } from "auth/decorators/auth.decorator";
65

76
@Controller()
87
export class ChatbotController {
98
constructor(private readonly chatBotService: ChatbotService) {}
109

11-
@M2MOrAbilities(INTEGRATION_ABILITY)
10+
@AdminOnly({ allowM2M: true })
1211
@Post("api/chatbot/hook")
1312
handleHook(@Req() req: Request, @Res() res: Response) {
1413
const response = this.chatBotService.sendMessage(req.body.message);

0 commit comments

Comments
 (0)