mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
refactor: original changes
This commit is contained in:
parent
fa9177180f
commit
f9c0e9853f
83 changed files with 413 additions and 505 deletions
4
api/cache/banViolation.js
vendored
4
api/cache/banViolation.js
vendored
|
|
@ -1,8 +1,8 @@
|
|||
const { ViolationTypes } = require('librechat-data-provider');
|
||||
const { deleteAllUserSessions } = require('@librechat/data-schemas');
|
||||
const { isEnabled, math, removePorts } = require('~/server/utils');
|
||||
const getLogStores = require('./getLogStores');
|
||||
const { logger } = require('~/config');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
|
||||
const { BAN_VIOLATIONS, BAN_INTERVAL } = process.env ?? {};
|
||||
const interval = math(BAN_INTERVAL, 20);
|
||||
|
|
@ -45,7 +45,7 @@ const banViolation = async (req, res, errorMessage) => {
|
|||
return;
|
||||
}
|
||||
|
||||
await db.models.Session.deleteAllUserSessions({ userId: user_id });
|
||||
await deleteAllUserSessions({ userId: user_id });
|
||||
res.clearCookie('refreshToken');
|
||||
|
||||
const banLogs = getLogStores(ViolationTypes.BAN);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue