Skip to content
Snippets Groups Projects
Commit 20d10b1b authored by esantangelo's avatar esantangelo
Browse files

bedelia

parent e8049717
No related branches found
No related tags found
1 merge request!47Feature/bedelia login
......@@ -135,5 +135,23 @@ namespace Bedelia.Controllers
return Ok(result);
}
[HttpPost("login")]
public async Task<IActionResult> Login(UserLoginDto userLoginDto)
{
var user = await _context.Users.FirstOrDefaultAsync(x => x.IdentityCard == userLoginDto.IdentityCard);
if (user == null)
{
return BadRequest(string.Format("el usuario con cédula {0} no existe en bedelia", userLoginDto.IdentityCard));
}
if (user.Password != userLoginDto.Password)
{
return BadRequest(string.Format("Contraseña incorrecta"));
}
return Ok();
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment