hcaptcha
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user