mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-18 14:34:23 +01:00
Remove unreachable code (#2961)
This commit is contained in:
@@ -241,15 +241,6 @@ namespace BTCPayServer.Controllers
|
|||||||
|
|
||||||
return RedirectToAction(nameof(SetPassword));
|
return RedirectToAction(nameof(SetPassword));
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet()]
|
|
||||||
public IActionResult DeleteUser()
|
|
||||||
{
|
|
||||||
return View("Confirm", new ConfirmModel("Delete account", "Your account will be permanently deleted. This action will also delete all stores, invoices, apps and data associated with your account.", "Delete")
|
|
||||||
{
|
|
||||||
ActionUrl = "DeleteUserPost"
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost()]
|
[HttpPost()]
|
||||||
public async Task<IActionResult> DeleteUserPost()
|
public async Task<IActionResult> DeleteUserPost()
|
||||||
@@ -257,7 +248,7 @@ namespace BTCPayServer.Controllers
|
|||||||
var user = await _userManager.GetUserAsync(User);
|
var user = await _userManager.GetUserAsync(User);
|
||||||
if (user == null)
|
if (user == null)
|
||||||
{
|
{
|
||||||
throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
await _userService.DeleteUserAndAssociatedData(user);
|
await _userService.DeleteUserAndAssociatedData(user);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
See more actions
|
See more actions
|
||||||
</button>
|
</button>
|
||||||
<div id="danger-zone" class="collapse">
|
<div id="danger-zone" class="collapse">
|
||||||
<a id="delete-user" class="btn btn-outline-danger mb-5" asp-action="DeleteUser" data-confirm-input="DELETE" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-action="DeleteUserPost" data-description="This action will also delete all stores, invoices, apps and data associated with the user.">Delete your user.</a>
|
<a id="delete-user" class="btn btn-outline-danger mb-5" data-confirm-input="DELETE" data-bs-toggle="modal" data-bs-target="#ConfirmModal" data-action="DeleteUserPost" data-description="This action will also delete all stores, invoices, apps and data associated with the user.">Delete your user.</a>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user