mirror of
https://github.com/strapi/strapi.git
synced 2025-12-26 22:54:31 +00:00
Fix /auth/login, user object was ignoring files and relations
Remove useless variables
This commit is contained in:
parent
04f0995b43
commit
0d1450bd19
@ -57,17 +57,15 @@ module.exports = {
|
||||
const isEmail = emailRegExp.test(params.identifier);
|
||||
|
||||
// Set the identifier to the appropriate query field.
|
||||
let key = "email";
|
||||
if (isEmail) {
|
||||
query.email = params.identifier.toLowerCase();
|
||||
} else {
|
||||
query.username = params.identifier;
|
||||
key = "username";
|
||||
}
|
||||
|
||||
const user = await strapi.plugins["users-permissions"]
|
||||
.queries("user", "users-permissions")
|
||||
.findOne(_.pick(query, [key, key]));
|
||||
.findOne(query);
|
||||
|
||||
if (!user) {
|
||||
return ctx.badRequest(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user