Remove LDAP admin check via group search in ldap-passport

This commit is contained in:
yu-i-i
2026-09-22 02:41:35 +02:00
parent a9bf9f7f63
commit 361b03b44b
2 changed files with 2 additions and 8 deletions
@@ -30,9 +30,8 @@ const LDAPAuthenticationManager = {
if (!firstName && !lastName) lastName = email
let isAdmin = false
if( attAdmin && valAdmin ) {
isAdmin = (profile._groups?.length > 0) ||
(Array.isArray(profile[attAdmin]) ? profile[attAdmin].includes(valAdmin) :
profile[attAdmin] === valAdmin)
isAdmin = Array.isArray(profile[attAdmin]) ? profile[attAdmin].includes(valAdmin) :
profile[attAdmin] === valAdmin
}
let user = await User.findOne({ 'email': email }).exec()