Skip to content

Commit

Permalink
2nd release def
Browse files Browse the repository at this point in the history
  • Loading branch information
angelalvaigle committed Dec 31, 2024
1 parent d639f9d commit 921eda2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion users/authservice/auth-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit 921eda2

Please sign in to comment.