Browse Source

fix: updating email wouldn't work

Kristian Vos 1 month ago
parent
commit
913535c1d3
1 changed files with 1 additions and 1 deletions
  1. 1 1
      backend/logic/users.js

+ 1 - 1
backend/logic/users.js

@@ -520,7 +520,7 @@ class _UsersModule extends CoreClass {
 		if (!user) throw new Error("User not found.");
 		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.");
 		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.");
 		if (existingUser) throw new Error("That email is already in use.");
 
 
 		const gravatarUrl = await UtilsModule.runJob("CREATE_GRAVATAR", { email }, this);
 		const gravatarUrl = await UtilsModule.runJob("CREATE_GRAVATAR", { email }, this);