Rate limit per IP the number of login attempt

This commit is contained in:
nicolas.dorier
2018-08-25 20:28:46 +09:00
parent 6c51d83f61
commit 023913a852
5 changed files with 21 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ using BTCPayServer.Services.Stores;
using BTCPayServer.Logging;
using BTCPayServer.Security;
using System.Globalization;
using NicolasDorier.RateLimits;
namespace BTCPayServer.Controllers
{
@@ -70,6 +71,7 @@ namespace BTCPayServer.Controllers
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
[RateLimitsFilter(ZoneLimits.Login, Scope = RateLimitsScope.RemoteAddress)]
public async Task<IActionResult> Login(LoginViewModel model, string returnUrl = null)
{
ViewData["ReturnUrl"] = returnUrl;