From 306da4ea63242e3f19e5ef11d441d68b1f6ec17d Mon Sep 17 00:00:00 2001 From: Isaac Abadi Date: Sat, 21 May 2022 22:59:39 -0400 Subject: [PATCH] LDAP logins no longer show error resulting from the required internal login attempt --- backend/authentication/auth.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/authentication/auth.js b/backend/authentication/auth.js index 7607c9b..e6fa23c 100644 --- a/backend/authentication/auth.js +++ b/backend/authentication/auth.js @@ -171,8 +171,12 @@ exports.registerUser = async function(req, res) { exports.login = async (username, password) => { + // even if we're using LDAP, we still want users to be able to login using internal credentials const user = await db_api.getRecord('users', {name: username}); - if (!user) { logger.error(`User ${username} not found`); return false } + if (!user) { + if (config_api.getConfigItem('ytdl_auth_method') === 'internal') logger.error(`User ${username} not found`); + return false; + } if (user.auth_method && user.auth_method !== 'internal') { return false } return await bcrypt.compare(password, user.passhash) ? user : false; }