Explorar o código

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

Owen Diffey %!s(int64=2) %!d(string=hai) anos
pai
achega
29ae27d697
Modificáronse 1 ficheiros con 2 adicións e 7 borrados
  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