4e089b5ebb
Activación de 2FA (TOTP) para el login del juego, guardando el secreto en acore_auth.account.totp_secret tal como lo lee el bnetserver 3.4.3. - lib/two-factor.ts: TOTP (HMAC-SHA1, 30s, 6 dígitos, ±1) idéntico al core (verificado contra los vectores RFC 6238), Base32, otpauth, y codificado del secreto: crudo por defecto o AES-128-GCM (ciphertext‖IV12‖tag12) si se define TOTP_MASTER_SECRET (mismo hex que TOTPMasterSecret del servidor). - Flujo seguro sin bloqueos: el secreto se genera y queda PENDIENTE en la sesión; sólo se escribe en la cuenta tras verificar un código válido. - /api/account/2fa: activar (password + token de seguridad), verificar y desactivar (con código actual). QR generado en el servidor (el secreto no sale a terceros). - Página + componente fieles al markup (preview, pasos, copiar clave, ojos). Verificado E2E: activar -> QR/secreto -> verificar -> totp_secret = 20 bytes (igual al secreto escaneado) -> desactivar -> NULL. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This is a Next.js project bootstrapped with create-next-app.
Getting Started
First, run the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
Open http://localhost:3000 with your browser to see the result.
You can start editing the page by modifying app/page.tsx. The page auto-updates as you edit the file.
This project uses next/font to automatically optimize and load Geist, a new font family for Vercel.
Learn More
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!
Deploy on Vercel
The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.
Check out our Next.js deployment documentation for more details.