diff --git a/components/user/userService.js b/components/user/userService.js index 2d55549..ddd6dd3 100644 --- a/components/user/userService.js +++ b/components/user/userService.js @@ -1,6 +1,7 @@ // userService.js const User = require('./userModel') const AppError = require('../../globalErrorHandler/AppError') +const redisClient = require('../../setup/redis') const jwt = require('jsonwebtoken') const bcrypt = require('bcryptjs') const maxAge = 60 * 60 * 24 * 90 @@ -85,9 +86,9 @@ const loginUser = async (email, password) => { const user = await User.findOne({ email }, null, null).select('+password') - // if (email) { - // await loginAttempt(email) - // } + if (email) { + await loginAttempt(email) + } if (!user || !(await bcrypt.compare(password, user.password))) { throw new AppError('IncorrectEmailOrPassword', 401, {})