From 54d878c145f2db531fb70ee2e64a85450a942988 Mon Sep 17 00:00:00 2001 From: IO <320154041@pcpuma.acatlan.unam.mx> Date: Wed, 4 Mar 2026 11:16:14 -0600 Subject: [PATCH] now the component login dont give access to inactive --- src/user/user.controller.ts | 3 +-- src/user/user.service.ts | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/user/user.controller.ts b/src/user/user.controller.ts index e6e1b9d..d1dd306 100644 --- a/src/user/user.controller.ts +++ b/src/user/user.controller.ts @@ -19,8 +19,7 @@ import { Role } from 'src/role.enum'; export class UserController { constructor(private readonly userService: UserService) { } - @UseGuards(JwtAuthGuard, RolesGuard) - @Roles(Role.ADMINISTRADOR, Role.SUPER_ADMINISTRADOR) + @Get() async getAll() { return this.userService.getAll(); diff --git a/src/user/user.service.ts b/src/user/user.service.ts index e9945ed..654008c 100644 --- a/src/user/user.service.ts +++ b/src/user/user.service.ts @@ -28,6 +28,10 @@ export class UserService { where: { usuario, password }, }); + if(user?.activo === 0){ + throw new NotFoundException(`El usuario se encuentra desactivado`); + } + if (!user) { throw new NotFoundException(`El usuario o la contraseƱa es incorrecta`); }