Registro + activación por email en Next.js (SRP6 + nodemailer)

- lib/mail.ts: transporte SMTP (nodemailer, mismas creds Gmail que Django).
- lib/register.ts: registerAccount (valida, comprueba email existente, crea fila en
  home_accountactivation reutilizando la tabla de Django, envía email de activación);
  activateAccount (crea battlenet_accounts con SRP6 v2 + account con SRP6 Grunt, como
  activate_account_view: expansion=2, battlenet_index=1; borra la activación).
- Route handlers /api/auth/register y /api/auth/activate.
- Páginas app/[locale]/register (RegisterForm cliente) y app/[locale]/activate-account
  (ActivateClient auto-POST al abrir el enlace). Textos en messages (Register, Activate).

Validado: validaciones (missingFields/passwordMismatch/invalidEmail/passwordTooLong);
ciclo completo activación->crea bnet+account->login OK con la cuenta creada
(needsSelection=false), password mala->invalidCredentials. Todo en TS, crypto validada.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-12 22:53:09 +00:00
parent e00a439dd9
commit f332fc39ca
12 changed files with 429 additions and 0 deletions
+27
View File
@@ -44,5 +44,32 @@
"noAccounts": "No game accounts were found linked to this Battle.net account.",
"entering": "Entering…",
"error": "The account could not be selected."
},
"Register": {
"title": "Create account",
"info": "Your account is Battle.net type: it is identified by your email. The password must be alphanumeric and up to 16 characters. The email must be a Gmail address.",
"password": "Password",
"confPassword": "Confirm password",
"email": "Gmail email address",
"confEmail": "Confirm email address",
"recruiter": "Recruiter (optional)",
"terms": "I accept the Rules, Terms and Conditions and Privacy Policy",
"submit": "Create account",
"creating": "Creating…",
"success": "The account has been created. Check your email to activate it.",
"missingFields": "Please fill in all fields.",
"passwordMismatch": "Passwords do not match.",
"passwordTooLong": "The password must not exceed 16 characters.",
"invalidEmail": "The email address is not valid.",
"emailExists": "An account with that email already exists.",
"recruiterNotFound": "The recruiter entered does not exist.",
"genericError": "Something went wrong. Please try again later."
},
"Activate": {
"activating": "Activating your account…",
"success": "Account activated! You can now sign in.",
"invalidLink": "The link is invalid or has already been used.",
"expiredLink": "The link has expired. Please request a new one.",
"goLogin": "Go to sign in"
}
}