Implementa la recuperación de cuenta (contraseña / cuentas / activación) + islas
recover_account_view era un stub que solo renderizaba (los formularios no tenían backend y el HTML arrastraba un reCAPTCHA de otro dominio). Ahora es funcional: Backend: - Modelo PasswordReset (token+email+expiración 1h) + migración 0014. - recover_account_view maneja POST JSON con 3 tipos, todo por email (bnet), con respuestas genéricas anti-enumeración: * password: crea token y envía enlace de reset (emails/password_reset.html). * accountname: envía las cuentas de juego ligadas (emails/account_names.html). * activation: reenvía el enlace de activación pendiente (emails/activation.html). - reset_password_view: GET valida el token (isla), POST re-deriva el verifier SRP6 v2 de la cuenta bnet (bnet.bnet_make_registration) y lo actualiza; marca el token usado. Ruta 'reset-password'. - Resiliente si la BD de cuentas (AzerothCore) no está disponible: mensaje limpio, nunca 500. Frontend (islas Vite): RecoverForm.tsx (selector de tipo + email) y ResetPassword.tsx (nueva contraseña con token). Se elimina el reCAPTCHA roto; se puede añadir uno propio si se aportan claves. Verificado en producción: los 3 flujos devuelven éxito genérico; reset valida token y contraseñas; token válido no provoca 500. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{% load django_vite %}
|
||||
<div class="main-page">
|
||||
<div class="middle-content">
|
||||
<div class="body-content">
|
||||
@@ -7,15 +8,15 @@
|
||||
<div class="body-box-content justified">
|
||||
<span>Si has olvidado la contraseña de la cuenta:</span>
|
||||
<p>- Selecciona la opción 'Contraseña'.</p>
|
||||
<p>- Escribe Nombre de usuario.</p>
|
||||
<p>- Escribe el correo electrónico de la cuenta.</p>
|
||||
<p>- Un correo será enviado con un enlace para generar una contraseña nueva.</p>
|
||||
<br>
|
||||
<span>Si has olvidado el nombre de la cuenta:</span>
|
||||
<span>Si has olvidado con qué cuentas de juego cuentas:</span>
|
||||
<p>- Selecciona la opción 'Nombre de cuenta'.</p>
|
||||
<p>- Escribe el correo electrónico.</p>
|
||||
<p>- Un correo será enviado con todas las cuentas ligadas al correo.</p>
|
||||
<br>
|
||||
<span>Si no has recibido en enlace de activación:</span>
|
||||
<span>Si no has recibido el enlace de activación:</span>
|
||||
<p>- Selecciona la opción 'Enlace de activación'.</p>
|
||||
<p>- Escribe el correo electrónico.</p>
|
||||
<p>- Un correo será enviado con el enlace de activación.</p>
|
||||
@@ -25,57 +26,15 @@
|
||||
<div class="box-content">
|
||||
<div class="title-box-content"><h2>Solicitud de información</h2></div>
|
||||
<div class="body-box-content centered">
|
||||
<p>Escoge la opción acorde a la información que quieres recuperar</p><p>
|
||||
<br>
|
||||
<select onchange="updateForm(this.value)" id="selection">
|
||||
<option value="recover-accountpassword-form" selected="selected">Contraseña</option>
|
||||
<option value="recover-accountname-form">Nombre de cuenta</option>
|
||||
<option value="recover-activationlink-form">Enlace de activación</option>
|
||||
</select>
|
||||
</p><form action="" method="POST" id="nw-recover-accountpassword-form" accept-charset="utf-8" style="">
|
||||
<table class="middle-center-table">
|
||||
<tbody><tr>
|
||||
<td><input type="text" maxlength="20" name="username" id="username" placeholder="Nombre de usuario"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="g-recaptcha g-recaptcha-div" id="gcaptcha" data-theme="dark" data-sitekey="6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI"><div style="width: 304px; height: 78px;"><div><iframe title="reCAPTCHA" width="304" height="78" role="presentation" name="a-qxqlxz4xlesu" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox allow-storage-access-by-user-activation" src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI&co=aHR0cHM6Ly91bHRpbW93b3cuY29tOjQ0Mw..&hl=en&v=-ZG7BC9TxCVEbzIO2m429usb&theme=dark&size=normal&cb=m8d6xkv8z4oz"></iframe></div><textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea></div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button type="submit" name="recover" class="recover-button" data-id="RecuperarInfo">Solicitar</button></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</form>
|
||||
<form action="" method="POST" id="nw-recover-accountname-form" accept-charset="utf-8" style="display: none;">
|
||||
<table class="middle-center-table">
|
||||
<tbody><tr>
|
||||
<td><input type="email" name="email" id="email" placeholder="Correo electrónico"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="g-recaptcha g-recaptcha-div" id="gcaptcha" data-theme="dark" data-sitekey="6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI"><div style="width: 304px; height: 78px;"><div><iframe title="reCAPTCHA" width="304" height="78" role="presentation" name="a-xflp6m78yzp" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox allow-storage-access-by-user-activation" src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI&co=aHR0cHM6Ly91bHRpbW93b3cuY29tOjQ0Mw..&hl=en&v=-ZG7BC9TxCVEbzIO2m429usb&theme=dark&size=normal&cb=3s51wzqngwmx"></iframe></div><textarea id="g-recaptcha-response-1" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea></div></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button type="submit" name="recover" class="recover-button" data-id="RecuperarInfo">Solicitar</button></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</form>
|
||||
<form action="" method="POST" id="nw-recover-activationlink-form" accept-charset="utf-8" style="display: none;">
|
||||
<table class="middle-center-table">
|
||||
<tbody><tr>
|
||||
<td><input type="text" maxlength="20" name="username" id="username" placeholder="Nombre de usuario"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><div class="g-recaptcha g-recaptcha-div" id="gcaptcha" data-theme="dark" data-sitekey="6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI"><div style="width: 304px; height: 78px;"><div><iframe title="reCAPTCHA" width="304" height="78" role="presentation" name="a-sv4k9abynly6" frameborder="0" scrolling="no" sandbox="allow-forms allow-popups allow-same-origin allow-scripts allow-top-navigation allow-modals allow-popups-to-escape-sandbox allow-storage-access-by-user-activation" src="https://www.google.com/recaptcha/api2/anchor?ar=1&k=6LcsJH4UAAAAAKqW0y4c-OVFijZjtZqkadRlpbRI&co=aHR0cHM6Ly91bHRpbW93b3cuY29tOjQ0Mw..&hl=en&v=-ZG7BC9TxCVEbzIO2m429usb&theme=dark&size=normal&cb=ujz7erfdzg8x"></iframe></div><textarea id="g-recaptcha-response-2" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px; resize: none; display: none;"></textarea></div><iframe style="display: none;"></iframe></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><button type="submit" name="recover" class="recover-button" data-id="RecuperarInfo">Solicitar</button></td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</form>
|
||||
<hr>
|
||||
<div class="alert-message" id="recover-response"></div>
|
||||
<!-- Isla React (Vite): recuperación de cuenta (contraseña / nombre de
|
||||
cuenta / reenvío de activación). POST a {% url 'recover' %} (JSON). -->
|
||||
<div id="recover-app"
|
||||
data-csrf="{{ csrf_token }}"
|
||||
data-recover-url="{% url 'recover' %}"></div>
|
||||
{% vite_asset 'src/entries/recover.tsx' %}
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user