refactor(AuthController): remove try-catch block

This commit is contained in:
Developer 02 2025-08-05 19:45:37 +02:00
parent 5f7e040e3e
commit 4725614bb3

View File

@ -39,8 +39,6 @@ public class AuthController : ControllerBase
[HttpGet("user")]
[Obsolete("Use MediatR")]
public async Task<IActionResult> GetUserWithClaims()
{
try
{
// Extract the username from the Name claim.
string? username = User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name)?.Value;
@ -55,12 +53,6 @@ public class AuthController : ControllerBase
return NotFound(Result.Fail().Message(_localizer[Key.UserNotFound]));
});
}
catch (Exception ex)
{
_logger.LogError(ex, "{Message}", ex.Message);
return StatusCode(StatusCodes.Status500InternalServerError);
}
}
[Authorize]
[HttpPost("logout")]