🔐 feat: Implement Allowed Action Domains (#4964)

* chore: RequestExecutor typing

* feat: allowed action domains

* fix: rename TAgentsEndpoint to TAssistantEndpoint in typedefs

* chore: update librechat-data-provider version to 0.7.62
This commit is contained in:
Danny Avila 2024-12-12 12:52:42 -05:00 committed by GitHub
parent e82af236bc
commit 69bd8e3644
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 364 additions and 97 deletions

View file

@ -1,4 +1,4 @@
const { isDomainAllowed } = require('~/server/services/AuthService');
const { isEmailDomainAllowed } = require('~/server/services/domains');
const { logger } = require('~/config');
/**
@ -14,7 +14,7 @@ const { logger } = require('~/config');
*/
const checkDomainAllowed = async (req, res, next = () => {}) => {
const email = req?.user?.email;
if (email && !(await isDomainAllowed(email))) {
if (email && !(await isEmailDomainAllowed(email))) {
logger.error(`[Social Login] [Social Login not allowed] [Email: ${email}]`);
return res.redirect('/login');
} else {