Skip to content

Commit

Permalink
cleanup redundant email.toLowerCase()
Browse files Browse the repository at this point in the history
Signed-off-by: Bobby Glidwell <sintex+github@gmail.com>
  • Loading branch information
bglidwell committed Sep 2, 2020
1 parent 50b5d58 commit 4565054
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 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.toLowerCase();
query.email = params.identifier;
} else {
query.username = params.identifier;
}
Expand Down Expand Up @@ -276,9 +276,7 @@ module.exports = {
// Check if the provided email is valid or not.
const isEmail = emailRegExp.test(email);

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

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

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

Expand Down

0 comments on commit 4565054

Please sign in to comment.