mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-27 08:25:07 +00:00
12 lines
289 B
TypeScript
12 lines
289 B
TypeScript
import { MongoUser } from './schema';
|
|
|
|
export async function authUserExist({ userId, username }: { userId?: string; username?: string }) {
|
|
if (userId) {
|
|
return MongoUser.findOne({ _id: userId });
|
|
}
|
|
if (username) {
|
|
return MongoUser.findOne({ username });
|
|
}
|
|
return null;
|
|
}
|