From 127753ee869d59c9fbdd9a4b3cf0184f271bb37d Mon Sep 17 00:00:00 2001 From: "DESKTOP-GENO133\\IvanPlex" Date: Sat, 20 Jan 2024 18:36:35 -0700 Subject: [PATCH] fixed 403 for API Controller. --- Controllers/{Error.cs => ErrorController.cs} | 5 +++++ 1 file changed, 5 insertions(+) rename Controllers/{Error.cs => ErrorController.cs} (59%) diff --git a/Controllers/Error.cs b/Controllers/ErrorController.cs similarity index 59% rename from Controllers/Error.cs rename to Controllers/ErrorController.cs index 5f72cb0..bd753f2 100644 --- a/Controllers/Error.cs +++ b/Controllers/ErrorController.cs @@ -6,6 +6,11 @@ namespace CarCareTracker.Controllers { public IActionResult Unauthorized() { + if (!User.IsInRole("CookieAuth")) + { + Response.StatusCode = 403; + return new EmptyResult(); + } return View("401"); } }