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
|
|
@ -5,8 +5,7 @@ const {
|
|||
getTOTPSecret,
|
||||
} = require('~/server/services/twoFactorService');
|
||||
const { setAuthTokens } = require('~/server/services/AuthService');
|
||||
const { logger } = require('~/config');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
const { User, logger } = require('@librechat/data-schemas');
|
||||
|
||||
/**
|
||||
* Verifies the 2FA code during login using a temporary token.
|
||||
|
|
@ -25,7 +24,7 @@ const verify2FAWithTempToken = async (req, res) => {
|
|||
return res.status(401).json({ message: 'Invalid or expired temporary token' });
|
||||
}
|
||||
|
||||
const user = await db.models.User.getUserById(payload.userId);
|
||||
const user = await User.getUserById(payload.userId);
|
||||
if (!user || !user.twoFactorEnabled) {
|
||||
return res.status(400).json({ message: '2FA is not enabled for this user' });
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue