fix(auth): flexibilizar login por email/usuario, asegurar hash admin123 y corregir cookies sobre HTTP
This commit is contained in:
@@ -270,17 +270,20 @@
|
||||
});
|
||||
}
|
||||
|
||||
// Demo login autofill buttons
|
||||
// Demo login autofill & instant submit (1 Clic)
|
||||
document.querySelectorAll('.demo-fill-btn').forEach(btn => {
|
||||
btn.addEventListener('click', function() {
|
||||
btn.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
const email = this.getAttribute('data-email');
|
||||
const usrField = document.getElementById('username');
|
||||
const pwdField = document.getElementById('password');
|
||||
const form = document.getElementById('localLoginForm');
|
||||
if (usrField && pwdField) {
|
||||
usrField.value = email;
|
||||
pwdField.value = 'admin123';
|
||||
usrField.classList.add('is-valid');
|
||||
setTimeout(() => usrField.classList.remove('is-valid'), 1500);
|
||||
if (form) {
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user