feat(auth): actualizar registro con fecha de nacimiento, clave min 6 chars y restablecimiento por correo
This commit is contained in:
+79
-9
@@ -79,11 +79,15 @@
|
||||
<input type="text" id="loginUsername" class="login-input" placeholder="Ej: padre, carlos_papa, 8888-1122 o mateo" required autocomplete="username">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<div class="login-form-group" style="margin-bottom: 8px;">
|
||||
<label id="lblLoginPass" for="loginPassword">Contraseña o PIN:</label>
|
||||
<input type="password" id="loginPassword" class="login-input" placeholder="••••••••" required autocomplete="current-password">
|
||||
</div>
|
||||
|
||||
<div style="display: flex; justify-content: flex-end; margin-top: -2px; margin-bottom: 14px;">
|
||||
<button type="button" onclick="switchSheetView('forgot')" style="background: none; border: none; color: #0284c7; font-weight: 700; cursor: pointer; text-decoration: underline; font-size: 0.8rem; padding: 0;">¿Olvidaste tu contraseña?</button>
|
||||
</div>
|
||||
|
||||
<div id="loginErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
|
||||
|
||||
<button type="submit" id="btnLoginSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
|
||||
@@ -95,7 +99,7 @@
|
||||
<div style="text-align: center; margin-top: 14px;">
|
||||
<p style="font-size: 0.82rem; color: #64748b; margin: 0;">
|
||||
¿Aún no tienes cuenta?
|
||||
<button type="button" onclick="switchSheetView('register')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">Regístrate como Padre aquí</button>
|
||||
<button type="button" onclick="switchSheetView('register')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">Regístrate aquí</button>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -127,15 +131,15 @@
|
||||
</details>
|
||||
</div>
|
||||
|
||||
<!-- CONTENIDO 2: REGISTRO DE PADRES -->
|
||||
<!-- CONTENIDO 2: REGISTRO DE CUENTA -->
|
||||
<div id="sheetContentRegister" style="display: none;">
|
||||
<div style="background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1.5px solid #bae6fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 36px; height: 36px; border-radius: 10px; background: white; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px;">
|
||||
<img src="/img/sibopay-emblem.png" alt="SiboPay" style="width: 100%; height: 100%; object-fit: contain;">
|
||||
</div>
|
||||
<div>
|
||||
<strong style="color: #0369a1; font-size: 0.86rem; display: block; font-weight: 800;">Registro de Padres o Encargados</strong>
|
||||
<span style="font-size: 0.72rem; color: #475569; display: block;">Crea tu cuenta para vincular a tus hijos y recargarles saldo con SINPE móvil.</span>
|
||||
<strong style="color: #0369a1; font-size: 0.86rem; display: block; font-weight: 800;">Crear Cuenta</strong>
|
||||
<span style="font-size: 0.72rem; color: #475569; display: block;">Crea tu cuenta para vincularte a los servicios y monedero digital SiboPay.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -145,14 +149,19 @@
|
||||
<input type="text" id="regNombre" class="login-input" placeholder="Ej: Carlos Alvarado Castro" required autocomplete="name">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="regFechaNacimiento">Fecha de Nacimiento:</label>
|
||||
<input type="date" id="regFechaNacimiento" class="login-input" required>
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="regTelefono">Teléfono o Celular (para SINPE):</label>
|
||||
<input type="tel" id="regTelefono" class="login-input" placeholder="Ej: 8888-1122" required autocomplete="tel">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="regEmail">Correo Electrónico <span style="font-size: 0.72rem; color: #64748b;">(Opcional)</span>:</label>
|
||||
<input type="email" id="regEmail" class="login-input" placeholder="Ej: [email protected]" autocomplete="email">
|
||||
<label for="regEmail">Correo Electrónico:</label>
|
||||
<input type="email" id="regEmail" class="login-input" placeholder="Ej: [email protected]" required autocomplete="email">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
@@ -162,14 +171,14 @@
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="regPassword">Contraseña:</label>
|
||||
<input type="password" id="regPassword" class="login-input" placeholder="Mínimo 4 caracteres" required autocomplete="new-password">
|
||||
<input type="password" id="regPassword" class="login-input" placeholder="Mínimo 6 caracteres" minlength="6" required autocomplete="new-password">
|
||||
</div>
|
||||
|
||||
<div id="registerErrorMsg" style="display: none; background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; padding: 8px 12px; border-radius: 10px; font-size: 0.8rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
|
||||
|
||||
<button type="submit" id="btnRegisterSubmit" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
|
||||
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="7" r="3.5"/><path d="M3 20v-1.5A4.5 4.5 0 0 1 7.5 14h3A4.5 4.5 0 0 1 15 18.5V20"/><circle cx="17.5" cy="7.5" r="2.5"/><path d="M15 14a3.5 3.5 0 0 1 5.5 3v3"/></svg>
|
||||
<span>Crear Cuenta de Padre y Entrar</span>
|
||||
<span>Crear Cuenta y Entrar</span>
|
||||
</button>
|
||||
</form>
|
||||
|
||||
@@ -180,6 +189,67 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- CONTENIDO 3: RESTABLECER CONTRASEÑA -->
|
||||
<div id="sheetContentForgot" style="display: none;">
|
||||
<div style="background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border: 1.5px solid #bae6fd; border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px;">
|
||||
<div style="width: 36px; height: 36px; border-radius: 10px; background: white; border: 1px solid #bae6fd; display: flex; align-items: center; justify-content: center; flex-shrink: 0; padding: 4px;">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="#0284c7" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="11" width="18" height="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>
|
||||
</div>
|
||||
<div>
|
||||
<strong style="color: #0369a1; font-size: 0.86rem; display: block; font-weight: 800;">Restablecer Contraseña</strong>
|
||||
<span style="font-size: 0.72rem; color: #475569; display: block;">Te enviaremos un código de seguridad a tu correo para crear una nueva clave.</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- PASO 1: ENVIAR CÓDIGO AL CORREO -->
|
||||
<div id="forgotStep1">
|
||||
<form id="formForgotRequest" onsubmit="handleForgotRequestSubmit(event)">
|
||||
<div class="login-form-group">
|
||||
<label for="forgotEmail">Correo Electrónico Registrado:</label>
|
||||
<input type="email" id="forgotEmail" class="login-input" placeholder="Ej: [email protected]" required autocomplete="email">
|
||||
</div>
|
||||
|
||||
<div id="forgotMsgStep1" style="display: none; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
|
||||
|
||||
<button type="submit" id="btnForgotSendCode" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #0284c7, #0369a1); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 2L11 13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
|
||||
<span id="lblBtnForgotSend">Enviar Código al Correo</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- PASO 2: INGRESAR CÓDIGO Y NUEVA CONTRASEÑA -->
|
||||
<div id="forgotStep2" style="display: none;">
|
||||
<form id="formForgotConfirm" onsubmit="handleForgotConfirmSubmit(event)">
|
||||
<div class="login-form-group">
|
||||
<label for="forgotCode">Código de Verificación (6 dígitos):</label>
|
||||
<input type="text" id="forgotCode" class="login-input" placeholder="Ej: 123456" maxlength="6" pattern="[0-9]{6}" required style="letter-spacing: 4px; font-size: 1.15rem; text-align: center; font-weight: 800;">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="forgotNewPass">Nueva Contraseña:</label>
|
||||
<input type="password" id="forgotNewPass" class="login-input" placeholder="Mínimo 6 caracteres" minlength="6" required autocomplete="new-password">
|
||||
</div>
|
||||
|
||||
<div class="login-form-group">
|
||||
<label for="forgotConfirmPass">Confirmar Nueva Contraseña:</label>
|
||||
<input type="password" id="forgotConfirmPass" class="login-input" placeholder="Repite la contraseña" minlength="6" required autocomplete="new-password">
|
||||
</div>
|
||||
|
||||
<div id="forgotMsgStep2" style="display: none; padding: 9px 12px; border-radius: 10px; font-size: 0.82rem; font-weight: 700; margin-bottom: 12px; text-align: center;"></div>
|
||||
|
||||
<button type="submit" id="btnForgotResetPass" class="login-submit-btn" style="display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 48px; border-radius: 12px; font-weight: 800; font-size: 1rem; background: linear-gradient(135deg, #10b981, #059669); color: white; border: none; cursor: pointer; box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);">
|
||||
<svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>
|
||||
<span id="lblBtnForgotReset">Cambiar Contraseña y Entrar</span>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-top: 14px;">
|
||||
<button type="button" onclick="switchSheetView('login')" style="background: none; border: none; color: #0284c7; font-weight: 800; cursor: pointer; text-decoration: underline; font-size: 0.82rem; padding: 0;">← Volver a Iniciar Sesión</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user