mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 11:20:15 +01:00
refactor: update domain validation to use appConfig for allowed domains
This commit is contained in:
parent
677481dde6
commit
50bd6d3a02
8 changed files with 43 additions and 61 deletions
|
|
@ -364,8 +364,10 @@ async function processRequiredActions(client, requiredActions) {
|
|||
const domain = await domainParser(action.metadata.domain, true);
|
||||
domainMap.set(domain, action);
|
||||
|
||||
// Check if domain is allowed
|
||||
const isDomainAllowed = await isActionDomainAllowed(action.metadata.domain);
|
||||
const isDomainAllowed = await isActionDomainAllowed(
|
||||
action.metadata.domain,
|
||||
appConfig?.registration?.allowedDomains,
|
||||
);
|
||||
if (!isDomainAllowed) {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -631,7 +633,10 @@ async function loadAgentTools({ req, res, agent, tool_resources, openAIApiKey })
|
|||
domainMap.set(domain, action);
|
||||
|
||||
// Check if domain is allowed (do this once per action set)
|
||||
const isDomainAllowed = await isActionDomainAllowed(action.metadata.domain);
|
||||
const isDomainAllowed = await isActionDomainAllowed(
|
||||
action.metadata.domain,
|
||||
appConfig?.registration?.allowedDomains,
|
||||
);
|
||||
if (!isDomainAllowed) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue