Fixed password with only numbers being rejected.

pull/5802/head
SamTV12345 2023-07-02 17:48:16 +02:00
parent 8e690aa342
commit 6ee4d3daaa
1 changed files with 4 additions and 1 deletions

View File

@ -149,7 +149,10 @@ const checkAccess = async (req, res, next) => {
if (!(await aCallFirst0('authenticate', ctx))) {
// Fall back to HTTP basic auth.
const {[ctx.username]: {password} = {}} = settings.users;
if (!httpBasicAuth || !ctx.username || password == null || password !== ctx.password) {
if (!httpBasicAuth ||
!ctx.username ||
password == null || password.toString() !== ctx.password) {
httpLogger.info(`Failed authentication from IP ${req.ip}`);
if (await aCallFirst0('authnFailure', {req, res})) return;
if (await aCallFirst0('authFailure', {req, res, next})) return;