mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-22 22:25:28 +01:00
Add rockstar friendly error 403
This commit is contained in:
parent
098879585a
commit
81c1cc6728
3 changed files with 21 additions and 1 deletions
|
@ -13,7 +13,7 @@ namespace BTCPayServer.Controllers
|
|||
{
|
||||
if (statusCode.HasValue)
|
||||
{
|
||||
var specialPages = new[] { 404, 406, 417, 429, 500, 502 };
|
||||
var specialPages = new[] { 404, 406, 417, 429, 500, 502, 403 };
|
||||
if (specialPages.Any(a => a == statusCode.Value))
|
||||
{
|
||||
var viewName = statusCode.ToString();
|
||||
|
@ -24,5 +24,10 @@ namespace BTCPayServer.Controllers
|
|||
}
|
||||
return this.StatusCode(statusCode.Value);
|
||||
}
|
||||
|
||||
public IActionResult Denied()
|
||||
{
|
||||
return Handle(403);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@ namespace BTCPayServer.Hosting
|
|||
services.PostConfigure<CookieAuthenticationOptions>(IdentityConstants.ApplicationScheme, opt =>
|
||||
{
|
||||
opt.LoginPath = "/login";
|
||||
opt.AccessDeniedPath = "/Error/Denied";
|
||||
});
|
||||
|
||||
services.Configure<SecurityStampValidatorOptions>(opts =>
|
||||
|
|
14
BTCPayServer/Views/Error/403.cshtml
Normal file
14
BTCPayServer/Views/Error/403.cshtml
Normal file
|
@ -0,0 +1,14 @@
|
|||
@{
|
||||
Layout = "_LayoutError";
|
||||
ViewData["Title"] = "403 - Denied";
|
||||
}
|
||||
|
||||
What are you looking at?
|
||||
<br /><br />
|
||||
<a href="https://twitter.com/r0ckstardev" target="_blank" rel="noreferrer noopener">
|
||||
<img src="~/img/errorpages/429_rockstardev.jpg" alt="Vin is angry because you caused 403" title="Move away that cursor" asp-append-version="true" />
|
||||
</a>
|
||||
<br /><br />
|
||||
It's not your business.
|
||||
<br /><br />
|
||||
Slowly <a href="/">navigate back to home</a>.
|
Loading…
Add table
Reference in a new issue