Unauthorized changet to Forbid

This commit is contained in:
Artemy
2025-07-21 17:16:51 +07:00
parent 4054e4046a
commit 93004a26b3
3 changed files with 4 additions and 9 deletions
+3 -3
View File
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Mvc;
namespace Govor.API.Controllers;
[ApiController]
[Authorize]
[Authorize(Roles = "Admin, User")]
[Route("api/chats")]
public class ChatLoadController : Controller
{
@@ -49,7 +49,7 @@ public class ChatLoadController : Controller
catch (UnauthorizedAccessException ex)
{
_logger.LogWarning(ex.Message);
return Unauthorized(ex.Message);
return Forbid(ex.Message);
}
catch (Exception ex)
{
@@ -84,7 +84,7 @@ public class ChatLoadController : Controller
catch (UnauthorizedAccessException ex)
{
_logger.LogWarning(ex.Message);
return Unauthorized(ex.Message);
return Forbid(ex.Message);
}
catch (Exception ex)
{