mirror of
https://github.com/getnamingo/registry.git
synced 2025-05-14 16:46:59 +02:00
Added ability to have password policy and password expiration
This commit is contained in:
parent
e0eeaed83c
commit
2620dfd7f3
5 changed files with 51 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue