Strong password pt 2

This commit is contained in:
2025-02-07 22:45:57 +08:00
parent c7bcd76299
commit fdfea2b1f0

View File

@@ -113,6 +113,11 @@ namespace AceJobAgency.Controllers
{
return BadRequest("Current password is incorrect.");
}
if (!AccountManagement.IsPasswordComplex(request.NewPassword))
{
return BadRequest("Password must be at least 12 characters long and include uppercase, lowercase, number, and special character.");
}
user.Password = BCrypt.Net.BCrypt.HashPassword(request.NewPassword);
user.UpdatedAt = DateTime.Now;