From 35b1f1a96a309ca85883438f7ae2e7fe9790f0fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 6 Sep 2022 09:39:22 +0900 Subject: [PATCH] nestjs_auth init.. --- src/user/user.controller.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/user/user.controller.ts b/src/user/user.controller.ts index 5dd32c1..99dd2ed 100644 --- a/src/user/user.controller.ts +++ b/src/user/user.controller.ts @@ -22,6 +22,8 @@ import { RolesGuard } from '../auth/guards/roles.guard' export class UserController { constructor(private readonly userService: UserService) {} + @Roles(Role.ADMIN) + @UseGuards(JwtAuthGuard, RolesGuard) @Get() async fetchAll(@Query() query): Promise { console.log(query) @@ -137,7 +139,7 @@ export class UserController { // @Roles(Role.USER) // @UseGuards(JwtAuthGuard, RolesGuard) //@UseGuards(JwtAuthGuard) - @Post() + @Post('register') async add(@Body() data: UserDTO): Promise { return await this.userService.add(data) }