mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-02-12 11:01:52 +00:00
Fixed server exception on password change.
This commit is contained in:
parent
474939bc64
commit
acd54b30c8
2 changed files with 154 additions and 1 deletions
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
|
// Callback: 0=OK, 1=OldPass, 2=CommonPass
|
||||||
obj.checkOldUserPasswords = function (domain, user, password, func) {
|
obj.checkOldUserPasswords = function (domain, user, password, func) {
|
||||||
// Check how many old passwords we need to check
|
// 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) {
|
if (user.oldpasswords != null) {
|
||||||
const extraOldPasswords = user.oldpasswords.length - domain.passwordrequirements.oldpasswordban;
|
const extraOldPasswords = user.oldpasswords.length - domain.passwordrequirements.oldpasswordban;
|
||||||
if (extraOldPasswords > 0) { user.oldpasswords.splice(0, extraOldPasswords); }
|
if (extraOldPasswords > 0) { user.oldpasswords.splice(0, extraOldPasswords); }
|
||||||
|
|
Loading…
Reference in a new issue