mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-09-11 08:55:32 +03:00
Fixed server exception on password change.
This commit is contained in:
parent
474939bc64
commit
acd54b30c8
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 New Issue
Block a user