Skip to content

Commit

Permalink
Revert "cleanup redundant email.toLowerCase()"
Browse files Browse the repository at this point in the history
This reverts commit 4565054.
  • Loading branch information
bglidwell committed Sep 3, 2020
1 parent 4565054 commit e2a95af
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/strapi-plugin-users-permissions/controllers/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = {

// Set the identifier to the appropriate query field.
if (isEmail) {
query.email = params.identifier;
query.email = params.identifier.toLowerCase();
} else {
query.username = params.identifier;
}
Expand Down Expand Up @@ -276,7 +276,9 @@ module.exports = {
// Check if the provided email is valid or not.
const isEmail = emailRegExp.test(email);

if (!isEmail) {
if (isEmail) {
email = email.toLowerCase();
} else {
return ctx.badRequest(
null,
formatError({
Expand Down Expand Up @@ -615,7 +617,9 @@ module.exports = {

const isEmail = emailRegExp.test(params.email);

if (!isEmail) {
if (isEmail) {
params.email = params.email.toLowerCase();
} else {
return ctx.badRequest('wrong.email');
}

Expand Down

0 comments on commit e2a95af

Please sign in to comment.