Sfoglia il codice sorgente

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

Owen Diffey 2 anni fa
parent
commit
29ae27d697
1 ha cambiato i file con 2 aggiunte e 7 eliminazioni
  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