Procházet zdrojové kódy

fix: Unable to login with username if it contains uppercase characters

Owen Diffey před 2 roky
rodič
revize
29ae27d697
1 změnil soubory, kde provedl 2 přidání a 7 odebrání
  1. 2 7
      backend/logic/actions/users.js

+ 2 - 7
backend/logic/actions/users.js

@@ -775,13 +775,8 @@ export default {
 				next => {
 					const query = {};
 					if (identifier.indexOf("@") !== -1) query["email.address"] = identifier;
-					else query.username = identifier;
-					userModel.findOne(
-						{
-							$or: [query]
-						},
-						next
-					);
+					else query.username = { $regex: `^${identifier}$`, $options: "i" };
+					userModel.findOne(query, next);
 				},
 
 				// if the user doesn't exist, respond with a failure