Procházet zdrojové kódy

fix: updating email wouldn't work

Kristian Vos před 1 měsícem
rodič
revize
913535c1d3
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  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.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);