|
@@ -520,7 +520,7 @@ class _UsersModule extends CoreClass {
|
|
|
if (!user) throw new Error("User not found.");
|
|
|
if (user.email.address === email) throw new Error("New email can't be the same as your the old email.");
|
|
|
|
|
|
- const existingUser = UsersModule.userModel.findOne({ "email.address": email });
|
|
|
+ const existingUser = await UsersModule.userModel.findOne({ "email.address": email });
|
|
|
if (existingUser) throw new Error("That email is already in use.");
|
|
|
|
|
|
const gravatarUrl = await UtilsModule.runJob("CREATE_GRAVATAR", { email }, this);
|