Esta é uma página restrita e de acesso exclusivo.
Acesso de Usuário
function srpAvaliarForca(senha) {
let forca = 0;
if (senha.length >= 8) forca++;
if (/[A-Z]/.test(senha)) forca++;
if (/[a-z]/.test(senha)) forca++;
if (/[0-9]/.test(senha)) forca++;
if (/[^A-Za-z0-9]/.test(senha)) forca++;
if (forca <= 2) return 'fraca';
if (forca === 3) return 'média';
return 'forte';
}
document.addEventListener('DOMContentLoaded', function () {
const senhaInput = document.getElementById('srp-senha-reg');
const forcaSenha = document.getElementById('srp-forcaSenha-reg');
if (senhaInput && forcaSenha) {
senhaInput.addEventListener('input', function () {
const nivel = srpAvaliarForca(this.value);
let mensagem = '';
let cor = '';
if (nivel === 'fraca') {
mensagem = '🔴 ' + "Senha fraca \u2014 use letras, n\u00fameros e s\u00edmbolos";
cor = '#d60000';
} else if (nivel === 'média') {
mensagem = '🟡 ' + "Senha m\u00e9dia \u2014 pode melhorar";
cor = '#e6a800';
} else {
mensagem = '🟢 ' + "Senha forte";
cor = '#007c00';
}
// Uso de textContent e style.color para evitar o alerta de innerHTML/HTML concatenation
forcaSenha.textContent = mensagem;
forcaSenha.style.color = cor;
});
}
});