void OnAuthorization(AuthorizationHandlerContext filterContext, vm.ResetUserPassword info) { if (!(Request.Has("Ticket"))) { filterContext.Fail(); } }
public async Task <ActionResult> Reset(vm.ResetUserPassword info) { if ((info.Ticket.IsExpired || info.Ticket.IsUsed)) { Notify("This ticket is no longer valid. Please request a new ticket."); return(JsonActions(info)); } await PasswordResetService.Complete(info.Ticket, info.Password.Trim()); return(AjaxRedirect(Url.Index("LoginResetPasswordConfirm", new { item = info.Ticket.UserId }))); }
public async Task OnBound(vm.ResetUserPassword info) { info.Item = info.Ticket.User; if (info.Item == null) { throw new Exception("This form expects an instance of the abstract type «User» to be provided to edit."); } if (Request.IsGet()) { await info.Item.CopyDataTo(info); } }
public async Task <ActionResult> Index(vm.ResetUserPassword info) { ModelState.Clear(); // Remove initial validation messages return(View(info)); }