fix(security): remove request-controlled write guards

This commit is contained in:
Alexandre Brandizzi 2026-07-31 21:52:41 -03:00
parent d3c4cdcf1c
commit 12b6bd859e

View file

@ -64,9 +64,6 @@ namespace Api.SeaHavenIndustries.Controllers
[HttpPost] [HttpPost]
public async Task<IActionResult> Create([FromBody] CreateVendorRosterDTO model, CancellationToken cancellationToken) public async Task<IActionResult> Create([FromBody] CreateVendorRosterDTO model, CancellationToken cancellationToken)
{ {
if (model == null)
return BadRequest(new Response { Status = "Error", Message = "Request body is required" });
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
if (userId == null) if (userId == null)
return Unauthorized(new Response { Status = "Error", Message = "User not authenticated" }); return Unauthorized(new Response { Status = "Error", Message = "User not authenticated" });
@ -97,9 +94,6 @@ namespace Api.SeaHavenIndustries.Controllers
[FromBody] ReconcileVendorRosterDTO model, [FromBody] ReconcileVendorRosterDTO model,
CancellationToken cancellationToken) CancellationToken cancellationToken)
{ {
if (model == null)
return BadRequest(new Response { Status = "Error", Message = "Request body is required" });
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier); var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
if (userId == null) if (userId == null)
return Unauthorized(new Response { Status = "Error", Message = "User not authenticated" }); return Unauthorized(new Response { Status = "Error", Message = "User not authenticated" });