added guard jwt

This commit is contained in:
2026-02-23 18:16:17 -06:00
parent 472bfebb7a
commit 18b869d681
19 changed files with 112 additions and 53 deletions
+4 -1
View File
@@ -4,7 +4,6 @@ import {
Post,
Body,
UseGuards,
Request,
Res,
Req,
} from '@nestjs/common';
@@ -17,16 +16,19 @@ import { JwtAuthGuard } from './jwt.guard';
export class UserController {
constructor(private readonly userService: UserService) {}
@UseGuards(JwtAuthGuard)
@Get()
async getAll() {
return this.userService.getAll();
}
@UseGuards(JwtAuthGuard)
@Get('/perfil')
async getAllPerfil() {
return this.userService.getAllPerfil();
}
@UseGuards(JwtAuthGuard)
@Post()
async Login(@Body() data: Login, @Res() res: Response) {
return this.userService.Login(data, res);
@@ -38,6 +40,7 @@ export class UserController {
return req.user.role;
}
@UseGuards(JwtAuthGuard)
@Post('/create')
async createUser(@Body() data: CreateUserDto) {
return this.userService.create(data);