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