From cfa9ef4726833d0e7c5dff6c18fd4575385c0d5f Mon Sep 17 00:00:00 2001 From: Nicode Date: Mon, 2 Jun 2025 20:53:39 +0800 Subject: [PATCH] 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. --- default/config.yaml | 2 +- src/users.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/default/config.yaml b/default/config.yaml index 00476a198..afc0ada2d 100644 --- a/default/config.yaml +++ b/default/config.yaml @@ -70,7 +70,7 @@ enableDiscreetLogin: false # https://www.authelia.com/ # This will use auto login to an account with the same username # 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 # If `basicAuthMode` and this are enabled then # the username and passwords for basic auth are the same as those diff --git a/src/users.js b/src/users.js index c1e631de5..812b16296 100644 --- a/src/users.js +++ b/src/users.js @@ -760,7 +760,7 @@ async function autheliaUserLogin(request) { const userHandles = await getAllUserHandles(); for (const userHandle of userHandles) { - if (remoteUser === userHandle) { + if (remoteUser.toLowerCase() === userHandle) { const user = await storage.getItem(toKey(userHandle)); if (user && user.enabled) { request.session.handle = userHandle;