mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-26 07:05:52 -05:00
Fixed server exception on password change.
This commit is contained in:
parent
146ef2c333
commit
c5030c2d3b
File diff suppressed because it is too large
Load Diff
@ -1873,7 +1873,7 @@ module.exports.CreateWebServer = function (parent, db, args, certificates) {
|
||||
// Callback: 0=OK, 1=OldPass, 2=CommonPass
|
||||
obj.checkOldUserPasswords = function (domain, user, password, func) {
|
||||
// Check how many old passwords we need to check
|
||||
if ((typeof domain.passwordrequirements.oldpasswordban == 'number') && (domain.passwordrequirements.oldpasswordban > 0)) {
|
||||
if ((domain.passwordrequirements != null) && (typeof domain.passwordrequirements.oldpasswordban == 'number') && (domain.passwordrequirements.oldpasswordban > 0)) {
|
||||
if (user.oldpasswords != null) {
|
||||
const extraOldPasswords = user.oldpasswords.length - domain.passwordrequirements.oldpasswordban;
|
||||
if (extraOldPasswords > 0) { user.oldpasswords.splice(0, extraOldPasswords); }
|
||||
|
Loading…
Reference in New Issue
Block a user