Merge pull request #443 from KuroSetsuna29/fix-ldap-login

Fixed issue preventing LDAP to create new account
This commit is contained in:
Tzahi12345
2021-09-12 12:57:51 -06:00
committed by GitHub

View File

@@ -140,7 +140,7 @@ exports.registerUser = async function(req, res) {
exports.login = async (username, password) => {
const user = await db_api.getRecord('users', {name: username});
if (!user) { logger.error(`User ${username} not found`); false }
if (!user) { 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;
}