mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 17:07:07 +01:00
eslint
This commit is contained in:
parent
69a604044d
commit
71236e5e8c
@ -31,7 +31,6 @@ const basicAuthMiddleware = async function (request, response, callback) {
|
||||
.toString('utf8')
|
||||
.split(':');
|
||||
|
||||
|
||||
if (! PERUSER_BASIC_AUTH && username === config.basicAuthUser.username && password === config.basicAuthUser.password) {
|
||||
return callback();
|
||||
} else if (PERUSER_BASIC_AUTH) {
|
||||
|
10
src/users.js
10
src/users.js
@ -624,7 +624,7 @@ async function authelia_user_login(request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const remote_user = request.get("Remote-User");
|
||||
const remote_user = request.get('Remote-User');
|
||||
if (!remote_user) {
|
||||
return false;
|
||||
}
|
||||
@ -652,18 +652,18 @@ async function basic_user_login(request) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const auth_header = request.get("Authorization");
|
||||
const auth_header = request.get('Authorization');
|
||||
if (!auth_header) {
|
||||
return false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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();
|
||||
for (const userHandle of userHandles) {
|
||||
@ -681,7 +681,7 @@ async function basic_user_login(request) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user