mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
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:
@@ -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")]
|
||||
|
||||
Reference in New Issue
Block a user