This commit is contained in:
2023-02-02 10:50:25 -06:00
parent 30bc761f3b
commit ebd6e8a608
7 changed files with 1213 additions and 1176 deletions
+5 -4
View File
@@ -1,8 +1,8 @@
import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
import { Recaptcha } from '@nestlab/google-recaptcha';
import { Serealize } from '../interceptors/serialize.interceptor';
import { HcaptchaGuard } from '../guards/hcaptcha.guard';
import { AuthService } from './auth.service';
import { LoginAdminDto } from './dto/input/login-admin.dto';
import { LoginOperadorDto } from './dto/input/login-operador.dto';
@@ -15,7 +15,7 @@ export class AuthController {
constructor(private authService: AuthService) {}
@Serealize(AuthTokenOutputDto)
@Recaptcha()
@UseGuards(HcaptchaGuard)
@Post('login-admin')
@ApiOperation({ description: 'Login del admin.' })
@ApiBody({
@@ -27,7 +27,7 @@ export class AuthController {
}
@Serealize(AuthTokenOutputDto)
@Recaptcha()
@UseGuards(HcaptchaGuard)
@Post('login-operador')
@ApiOperation({ description: 'Login del operador.' })
@ApiBody({
@@ -37,6 +37,7 @@ export class AuthController {
},
})
loginOperador(@Body() body: LoginOperadorDto) {
console.log('Hola');
return this.authService.loginOperador(
body.id_modulo,
body.operador,
@@ -45,7 +46,7 @@ export class AuthController {
}
@Serealize(AuthTokenOutputDto)
@Recaptcha()
@UseGuards(HcaptchaGuard)
@Post('login-usuario')
@ApiOperation({ description: 'Login del usuario.' })
@ApiBody({