get user by email

This commit is contained in:
Michael Fatemi 2021-04-10 18:58:20 -04:00
parent 956ba14e29
commit 01aa0f45d7

View File

@ -72,9 +72,11 @@ export function getGroupByID(groupID: string): Carpool.Group | undefined {
export async function getUserByEmail( export async function getUserByEmail(
email: string email: string
): Promise<Carpool.User | undefined> { ): Promise<Carpool.User | undefined> {
return ((await UserModel.findOne({ return ((
email, await UserModel.findOne({
}).exec()) as unknown) as Carpool.User; email,
}).exec()
).toJSON() as unknown) as Carpool.User;
} }
export async function registerUserFromIonProfile( export async function registerUserFromIonProfile(