Files
FastGPT/packages/service/support/user/controller.ts
2023-11-09 09:46:57 +08:00

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;
}