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(
email: string
): Promise<Carpool.User | undefined> {
return ((await UserModel.findOne({
email,
}).exec()) as unknown) as Carpool.User;
return ((
await UserModel.findOne({
email,
}).exec()
).toJSON() as unknown) as Carpool.User;
}
export async function registerUserFromIonProfile(