diff --git a/users/authservice/auth-controller.js b/users/authservice/auth-controller.js index a58b3fb..e42702e 100644 --- a/users/authservice/auth-controller.js +++ b/users/authservice/auth-controller.js @@ -18,9 +18,10 @@ export const loginController = async (req, res) => { validateRequiredFields(req, ['username', 'password']); const { username, password } = req.body; + const loginUser = String(username); // Buscar el usuario por nombre en la base de datos - const user = await User.findOne({ username }); + const user = await User.findOne({ username: loginUser }); // Verificar que el usuario exista y la contraseƱa sea correcta if (user && (await comparePassword(password, user.password))) {