This commit is contained in:
QuantumEntangledAndy 2024-10-06 15:06:05 +07:00
parent 69a604044d
commit 71236e5e8c
No known key found for this signature in database
GPG Key ID: 3EB4B66F30C609B6
2 changed files with 5 additions and 6 deletions

View File

@ -31,7 +31,6 @@ const basicAuthMiddleware = async function (request, response, callback) {
.toString('utf8') .toString('utf8')
.split(':'); .split(':');
if (! PERUSER_BASIC_AUTH && username === config.basicAuthUser.username && password === config.basicAuthUser.password) { if (! PERUSER_BASIC_AUTH && username === config.basicAuthUser.username && password === config.basicAuthUser.password) {
return callback(); return callback();
} else if (PERUSER_BASIC_AUTH) { } else if (PERUSER_BASIC_AUTH) {

View File

@ -624,7 +624,7 @@ async function authelia_user_login(request) {
return false; return false;
} }
const remote_user = request.get("Remote-User"); const remote_user = request.get('Remote-User');
if (!remote_user) { if (!remote_user) {
return false; return false;
} }
@ -652,18 +652,18 @@ async function basic_user_login(request) {
return false; return false;
} }
const auth_header = request.get("Authorization"); const auth_header = request.get('Authorization');
if (!auth_header) { if (!auth_header) {
return false; return false;
} }
const parts = auth_header.split(' '); const parts = auth_header.split(' ');
if (!parts || parts.length < 2 || parts[0].toLowerCase() != "basic") { if (!parts || parts.length < 2 || parts[0].toLowerCase() != 'basic') {
return false; return false;
} }
const b64auth = parts[1]; const b64auth = parts[1];
const [login, password] = Buffer.from(b64auth, 'base64').toString().split(':') const [login, password] = Buffer.from(b64auth, 'base64').toString().split(':');
const userHandles = await getAllUserHandles(); const userHandles = await getAllUserHandles();
for (const userHandle of userHandles) { for (const userHandle of userHandles) {