Cannot change password when maxPasswordHistory is 1 (#5191)
* Negitive to zero and positive to same value * add failing test
This commit is contained in:
committed by
Arthur Cinader
parent
c7eb7daeae
commit
a3746cab00
@@ -1284,7 +1284,7 @@ RestWrite.prototype.runDatabaseOperation = function() {
|
||||
//n-1 passwords go into history including last password
|
||||
while (
|
||||
oldPasswords.length >
|
||||
this.config.passwordPolicy.maxPasswordHistory - 2
|
||||
Math.max(0, this.config.passwordPolicy.maxPasswordHistory - 2)
|
||||
) {
|
||||
oldPasswords.shift();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user