Added ability to have password policy and password expiration

This commit is contained in:
Pinga 2025-02-11 15:50:29 +02:00
parent e0eeaed83c
commit 2620dfd7f3
5 changed files with 51 additions and 3 deletions

View file

@ -693,8 +693,10 @@ function checkPasswordComplexity($password) {
$score = $zxcvbn->passwordStrength($password)['score'];
if ($score < $requiredScore) { // Score ranges from 0 (weak) to 4 (strong)
throw new Exception('Password too weak. Use a stronger password.');
return false;
}
return true;
}
function checkPasswordRenewal($lastPasswordUpdateTimestamp) {