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:
@@ -242,22 +242,13 @@ namespace BTCPayServer.Controllers
|
||||
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()]
|
||||
public async Task<IActionResult> DeleteUserPost()
|
||||
{
|
||||
var user = await _userManager.GetUserAsync(User);
|
||||
if (user == null)
|
||||
{
|
||||
throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'.");
|
||||
return NotFound();
|
||||
}
|
||||
|
||||
await _userService.DeleteUserAndAssociatedData(user);
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
See more actions
|
||||
</button>
|
||||
<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>
|
||||
</form>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user