瀏覽代碼

fix: updating email wouldn't work

Kristian Vos 1 月之前
父節點
當前提交
913535c1d3
共有 1 個文件被更改,包括 1 次插入1 次删除
  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);