first commit
This commit is contained in:
17
Controllers/ErrorController.cs
Normal file
17
Controllers/ErrorController.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace MotoVaultPro.Controllers
|
||||
{
|
||||
public class ErrorController : Controller
|
||||
{
|
||||
public IActionResult Unauthorized()
|
||||
{
|
||||
if (User.IsInRole("APIAuth"))
|
||||
{
|
||||
Response.StatusCode = 403;
|
||||
return new EmptyResult();
|
||||
}
|
||||
return View("401");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user