fixes user's auto-deletion :-)

vnext
Paul Schneider 5 years ago
parent c01fae9c3a
commit 7143c1feeb
3 changed files with 6 additions and 1 deletions

@ -1,8 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace Yavsc.ViewModels.Account
{
public class UnregisterViewModel
{
[Required]
public string UserId { get; set; }
public string ReturnUrl { get; set; }
}

@ -687,7 +687,7 @@ namespace Yavsc.Controllers
[HttpGet, Authorize]
public IActionResult Delete()
{
return View();
return View(new UnregisterViewModel { UserId = User.GetUserId() });
}
[HttpGet, Authorize("AdministratorOnly")]

@ -8,6 +8,7 @@
<form asp-controller="Account" asp-action="Delete" method="post" class="form-horizontal" role="form">
@Html.Hidden("ReturnUrl")
@Html.Hidden("UserId")
<input type="submit" value="@SR["Unregister"]" class="btn btn-default"/>
</form>

Loading…