mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 02:10:15 +01:00
refactor: original changes
This commit is contained in:
parent
fa9177180f
commit
f9c0e9853f
83 changed files with 413 additions and 505 deletions
|
|
@ -1,8 +1,8 @@
|
|||
const path = require('path');
|
||||
const { User } = require('@librechat/data-schemas');
|
||||
require('module-alias')({ base: path.resolve(__dirname, '..', 'api') });
|
||||
const { registerUser } = require('~/server/services/AuthService');
|
||||
const { askQuestion, silentExit } = require('./helpers');
|
||||
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 db.models.User.findOne({ $or: [{ email }, { username }] });
|
||||
const userExists = await 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