Update server.js

Print warning if basicAuth username or password fails to parse.

In a normal case the user has no way to be informed if the username or password fails to parse. While this might end up being a skill issue on the users side it could help them to troubleshoot the issue.
This commit is contained in:
Lumi 2024-03-30 19:57:23 +01:00 committed by GitHub
parent da035d4984
commit a8388259ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 12 additions and 0 deletions

View File

@ -655,6 +655,18 @@ const setupTasks = async function () {
if (listen) {
console.log('\n0.0.0.0 means SillyTavern is listening on all network interfaces (Wi-Fi, LAN, localhost). If you want to limit it only to internal localhost (127.0.0.1), change the setting in config.yaml to "listen: false". Check "access.log" file in the SillyTavern directory if you want to inspect incoming connections.\n');
}
if (getConfigValue("basicAuthMode", false)) {
const basicAuthUser = getConfigValue("basicAuthUser", null);
if (!basicAuthUser.username || !basicAuthUser.password) {
console.warn(
color.yellow(
"Basic Authentication is set, but username or password is not set or empty!"
)
);
}
}
};
/**