mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
Remove LDAP admin check via group search in ldap-passport
This commit is contained in:
@@ -30,9 +30,8 @@ const LDAPAuthenticationManager = {
|
|||||||
if (!firstName && !lastName) lastName = email
|
if (!firstName && !lastName) lastName = email
|
||||||
let isAdmin = false
|
let isAdmin = false
|
||||||
if( attAdmin && valAdmin ) {
|
if( attAdmin && valAdmin ) {
|
||||||
isAdmin = (profile._groups?.length > 0) ||
|
isAdmin = Array.isArray(profile[attAdmin]) ? profile[attAdmin].includes(valAdmin) :
|
||||||
(Array.isArray(profile[attAdmin]) ? profile[attAdmin].includes(valAdmin) :
|
profile[attAdmin] === valAdmin
|
||||||
profile[attAdmin] === valAdmin)
|
|
||||||
}
|
}
|
||||||
let user = await User.findOne({ 'email': email }).exec()
|
let user = await User.findOne({ 'email': email }).exec()
|
||||||
|
|
||||||
|
|||||||
@@ -31,11 +31,6 @@ const LDAPModuleManager = {
|
|||||||
searchFilter: process.env.OVERLEAF_LDAP_SEARCH_FILTER,
|
searchFilter: process.env.OVERLEAF_LDAP_SEARCH_FILTER,
|
||||||
searchScope: process.env.OVERLEAF_LDAP_SEARCH_SCOPE || 'sub',
|
searchScope: process.env.OVERLEAF_LDAP_SEARCH_SCOPE || 'sub',
|
||||||
searchAttributes: JSON.parse(process.env.OVERLEAF_LDAP_SEARCH_ATTRIBUTES || '[]'),
|
searchAttributes: JSON.parse(process.env.OVERLEAF_LDAP_SEARCH_ATTRIBUTES || '[]'),
|
||||||
groupSearchBase: process.env.OVERLEAF_LDAP_ADMIN_SEARCH_BASE,
|
|
||||||
groupSearchFilter: process.env.OVERLEAF_LDAP_ADMIN_SEARCH_FILTER,
|
|
||||||
groupSearchScope: process.env.OVERLEAF_LDAP_ADMIN_SEARCH_SCOPE || 'sub',
|
|
||||||
groupSearchAttributes: ["dn"],
|
|
||||||
groupDnProperty: process.env.OVERLEAF_LDAP_ADMIN_DN_PROPERTY,
|
|
||||||
cache: boolFromEnv(process.env.OVERLEAF_LDAP_CACHE),
|
cache: boolFromEnv(process.env.OVERLEAF_LDAP_CACHE),
|
||||||
timeout: numFromEnv(process.env.OVERLEAF_LDAP_TIMEOUT),
|
timeout: numFromEnv(process.env.OVERLEAF_LDAP_TIMEOUT),
|
||||||
connectTimeout: numFromEnv(process.env.OVERLEAF_LDAP_CONNECT_TIMEOUT),
|
connectTimeout: numFromEnv(process.env.OVERLEAF_LDAP_CONNECT_TIMEOUT),
|
||||||
|
|||||||
Reference in New Issue
Block a user