Correction PDF
This commit is contained in:
@@ -104,5 +104,15 @@ namespace administration.Controllers
|
||||
|
||||
return Content("✅ Mot de passe mis à jour avec succès");
|
||||
}
|
||||
|
||||
[HttpGet("/tools/hash")]
|
||||
[Authorize] // et/ou protège par un flag d'env
|
||||
public IActionResult HashTool(string username, string password, [FromServices] IPasswordHasher<User> hasher)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(username) || string.IsNullOrWhiteSpace(password)) return BadRequest("username/password requis");
|
||||
var hash = hasher.HashPassword(new User { Username = username }, password);
|
||||
return Content(hash);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user