mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
feat: add check for People.Read scope in searchContacts
This commit is contained in:
parent
c9aa10d3d5
commit
1016a33b89
1 changed files with 7 additions and 1 deletions
|
|
@ -211,7 +211,13 @@ const searchContacts = async (graphClient, query, limit = 10) => {
|
||||||
if (!query || query.trim().length < 2) {
|
if (!query || query.trim().length < 2) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
process.env.OPENID_GRAPH_SCOPES &&
|
||||||
|
!process.env.OPENID_GRAPH_SCOPES.toLowerCase().includes('people.read')
|
||||||
|
) {
|
||||||
|
logger.warn('[searchContacts] People.Read scope is not enabled, skipping contact search');
|
||||||
|
return [];
|
||||||
|
}
|
||||||
// Reason: Search only for OrganizationUser (person) type, not groups
|
// Reason: Search only for OrganizationUser (person) type, not groups
|
||||||
const filter = "personType/subclass eq 'OrganizationUser'";
|
const filter = "personType/subclass eq 'OrganizationUser'";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue