fix: lowercase remote-user header in authelia auto-login procedure

Ensure the remote-user header is lowercased to fix case-sensitivity issues in the authelia auto-login process, improving compatibility.
This commit is contained in:
Nicode
2025-06-02 20:53:39 +08:00
parent 303c1dcf14
commit cfa9ef4726
2 changed files with 2 additions and 2 deletions

View File

@@ -70,7 +70,7 @@ enableDiscreetLogin: false
# https://www.authelia.com/ # https://www.authelia.com/
# This will use auto login to an account with the same username # This will use auto login to an account with the same username
# as that used for authlia. (Ensure the username in authlia # as that used for authlia. (Ensure the username in authlia
# is an exact match with that in sillytavern) # is an exact match in lowercase with that in sillytavern)
autheliaAuth: false autheliaAuth: false
# If `basicAuthMode` and this are enabled then # If `basicAuthMode` and this are enabled then
# the username and passwords for basic auth are the same as those # the username and passwords for basic auth are the same as those

View File

@@ -760,7 +760,7 @@ async function autheliaUserLogin(request) {
const userHandles = await getAllUserHandles(); const userHandles = await getAllUserHandles();
for (const userHandle of userHandles) { for (const userHandle of userHandles) {
if (remoteUser === userHandle) { if (remoteUser.toLowerCase() === userHandle) {
const user = await storage.getItem(toKey(userHandle)); const user = await storage.getItem(toKey(userHandle));
if (user && user.enabled) { if (user && user.enabled) {
request.session.handle = userHandle; request.session.handle = userHandle;