mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-09 18:41:29 +03:00
LDAP logins no longer show error resulting from the required internal login attempt
This commit is contained in:
@@ -171,8 +171,12 @@ exports.registerUser = async function(req, res) {
|
|||||||
|
|
||||||
|
|
||||||
exports.login = async (username, password) => {
|
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});
|
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 }
|
if (user.auth_method && user.auth_method !== 'internal') { return false }
|
||||||
return await bcrypt.compare(password, user.passhash) ? user : false;
|
return await bcrypt.compare(password, user.passhash) ? user : false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user