소스 검색

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);