Only allow login via basic per-user if user password is set

This commit is contained in:
QuantumEntangledAndy 2024-10-09 15:04:28 +07:00
parent fe1f9fafbd
commit 06a7bdd3ce
No known key found for this signature in database
GPG Key ID: 3EB4B66F30C609B6
2 changed files with 0 additions and 9 deletions

View File

@ -43,10 +43,6 @@ const basicAuthMiddleware = async function (request, response, callback) {
if (user && user.enabled && (user.password && user.password === getPasswordHash(password, user.salt))) {
return callback();
}
else if (user && user.enabled && !user.password && !password) {
// Login to an account without password
return callback();
}
}
}
}

View File

@ -678,11 +678,6 @@ async function basicUserLogin(request) {
request.session.handle = userHandle;
return true;
}
else if (user && user.enabled && !user.password && !password) {
// Login to an account without password
request.session.handle = userHandle;
return true;
}
}
}