From 9671cd06872a90d23a1349869a0073e5a05565c5 Mon Sep 17 00:00:00 2001 From: Cassie Tarakajian Date: Mon, 6 Apr 2020 19:02:55 -0400 Subject: [PATCH] Fix linting errors --- server/controllers/user.controller.js | 2 +- server/models/user.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server/controllers/user.controller.js b/server/controllers/user.controller.js index d552e648..f06c3d99 100644 --- a/server/controllers/user.controller.js +++ b/server/controllers/user.controller.js @@ -46,7 +46,7 @@ export function createUser(req, res, next) { const EMAIL_VERIFY_TOKEN_EXPIRY_TIME = Date.now() + (3600000 * 24); // 24 hours random((tokenError, token) => { const user = new User({ - username: username, + username, email: emailLowerCase, password, verified: User.EmailConfirmation.Sent, diff --git a/server/models/user.js b/server/models/user.js index d5e5d8f6..321c2231 100644 --- a/server/models/user.js +++ b/server/models/user.js @@ -147,7 +147,7 @@ userSchema.statics.findByMailOrName = function findByMailOrName(email) { $or: [{ email: new RegExp(`^${escapeStringRegexp(email)}$`, 'i'), }, { - username: new RegExp(`^${escapeStringRegexp(email)}$`, 'i'), + username: new RegExp(`^${escapeStringRegexp(email)}$`, 'i'), }], }; return this.findOne(query).exec();