mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
Move usermethods and models to data-schema
This commit is contained in:
parent
4808c5be48
commit
4049b5572c
93 changed files with 2396 additions and 1267 deletions
|
|
@ -2,7 +2,7 @@ const path = require('path');
|
|||
require('module-alias')({ base: path.resolve(__dirname, '..', 'api') });
|
||||
const { registerUser } = require('~/server/services/AuthService');
|
||||
const { askQuestion, silentExit } = require('./helpers');
|
||||
const User = require('~/models/User');
|
||||
const db = require('~/lib/db/connectDb');
|
||||
const connect = require('./connect');
|
||||
|
||||
(async () => {
|
||||
|
|
@ -92,7 +92,7 @@ or the user will need to attempt logging in to have a verification link sent to
|
|||
}
|
||||
}
|
||||
|
||||
const userExists = await User.findOne({ $or: [{ email }, { username }] });
|
||||
const userExists = await db.models.User.findOne({ $or: [{ email }, { username }] });
|
||||
if (userExists) {
|
||||
console.red('Error: A user with that email or username already exists!');
|
||||
silentExit(1);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue