SEC-001: migrar HcaptchaGuard a TurnstileGuard con siteverify Cloudflare.

Bypass solo en desarrollo; pruebas y producción validan header turnstile vía HTTPS nativo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Edrei Téllez
2026-06-12 17:19:14 -06:00
parent e5076603fd
commit ce1d1396e0
6 changed files with 86 additions and 55 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ import { Body, Controller, Get, Post, UseGuards } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { ApiBody, ApiOperation, ApiTags } from '@nestjs/swagger';
import { Serealize } from '../interceptors/serialize.interceptor';
import { HcaptchaGuard } from '../guards/hcaptcha.guard';
import { TurnstileGuard } from '../guards/turnstile.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)
@UseGuards(HcaptchaGuard)
@UseGuards(TurnstileGuard)
@Post('login-admin')
@ApiOperation({ description: 'Login del admin.' })
@ApiBody({
@@ -27,7 +27,7 @@ export class AuthController {
}
@Serealize(AuthTokenOutputDto)
@UseGuards(HcaptchaGuard)
@UseGuards(TurnstileGuard)
@Post('login-operador')
@ApiOperation({ description: 'Login del operador.' })
@ApiBody({
@@ -45,7 +45,7 @@ export class AuthController {
}
@Serealize(AuthTokenOutputDto)
@UseGuards(HcaptchaGuard)
@UseGuards(TurnstileGuard)
@Post('login-usuario')
@ApiOperation({ description: 'Login del usuario.' })
@ApiBody({