feat: add admin route guard for the authentication
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { UseGuards, applyDecorators } from "@nestjs/common";
|
||||
import { ApiBearerAuth } from "@nestjs/swagger";
|
||||
|
||||
import { AdminRouteGuard } from "../../modules/auth/guards/admin.guard";
|
||||
import { JwtAuthGuard } from "../../modules/auth/guards/auth.guard";
|
||||
|
||||
export function AuthGuards() {
|
||||
return applyDecorators(UseGuards(JwtAuthGuard), ApiBearerAuth("authorization"));
|
||||
return applyDecorators(UseGuards(JwtAuthGuard, AdminRouteGuard), ApiBearerAuth("authorization"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user