示例#1
0
 void OnAuthorization(AuthorizationHandlerContext filterContext, vm.ResetUserPassword info)
 {
     if (!(Request.Has("Ticket")))
     {
         filterContext.Fail();
     }
 }
示例#2
0
        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 })));
        }
示例#3
0
        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);
            }
        }
示例#4
0
        public async Task <ActionResult> Index(vm.ResetUserPassword info)
        {
            ModelState.Clear(); // Remove initial validation messages

            return(View(info));
        }