mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
* wip: first pass, custom endpoint agents * chore: imports * chore: consolidate exports * fix: imports * feat: convert message.content array to strings for legacy format handling (deepseek/groq) * refactor: normalize ollama endpoint name * refactor: update mocking in isDomainAllowed.spec.js * refactor: update deepseekModels in tokens.js and tokens.spec.js
24 lines
499 B
JavaScript
24 lines
499 B
JavaScript
const { getCustomConfig } = require('~/server/services/Config');
|
|
|
|
async function isDomainAllowed(email) {
|
|
if (!email) {
|
|
return false;
|
|
}
|
|
|
|
const domain = email.split('@')[1];
|
|
|
|
if (!domain) {
|
|
return false;
|
|
}
|
|
|
|
const customConfig = await getCustomConfig();
|
|
if (!customConfig) {
|
|
return true;
|
|
} else if (!customConfig?.registration?.allowedDomains) {
|
|
return true;
|
|
}
|
|
|
|
return customConfig.registration.allowedDomains.includes(domain);
|
|
}
|
|
|
|
module.exports = isDomainAllowed;
|