Allow Users to be disabled/enabled (#3639)

* Allow Users to be disabled/enabled

* rebrand to locked for api

* Update BTCPayServer/Views/UIAccount/Lockout.cshtml

Co-authored-by: d11n <mail@dennisreimann.de>

* fix docker compose and an uneeded check in api handler

* fix

* Add enabled user test

Co-authored-by: d11n <mail@dennisreimann.de>
Co-authored-by: Nicolas Dorier <nicolas.dorier@gmail.com>
This commit is contained in:
Andrew Camilleri
2022-04-26 14:27:35 +02:00
committed by GitHub
parent 261a3ecee3
commit 273bc78db3
16 changed files with 290 additions and 61 deletions

View File

@@ -209,7 +209,7 @@ namespace BTCPayServer.Controllers
if (result.IsLockedOut)
{
_logger.LogWarning($"User '{user.Id}' account locked out.");
return RedirectToAction(nameof(Lockout));
return RedirectToAction(nameof(Lockout), new { user.LockoutEnd});
}
else
{
@@ -428,7 +428,7 @@ namespace BTCPayServer.Controllers
else if (result.IsLockedOut)
{
_logger.LogWarning("User with ID {UserId} account locked out.", user.Id);
return RedirectToAction(nameof(Lockout));
return RedirectToAction(nameof(Lockout), new { user.LockoutEnd});
}
else
{
@@ -497,7 +497,8 @@ namespace BTCPayServer.Controllers
if (result.IsLockedOut)
{
_logger.LogWarning("User with ID {UserId} account locked out.", user.Id);
return RedirectToAction(nameof(Lockout));
return RedirectToAction(nameof(Lockout), new { user.LockoutEnd});
}
else
{
@@ -509,9 +510,9 @@ namespace BTCPayServer.Controllers
[HttpGet("/login/lockout")]
[AllowAnonymous]
public IActionResult Lockout()
public IActionResult Lockout(DateTimeOffset? lockoutEnd)
{
return View();
return View(lockoutEnd);
}
[HttpGet("/register")]