Esempio n. 1
0
        public IActionResult OnPostForgetPassword(ForgetPasswordUserVM data)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToPage("ForgetPassword"));
            }

            var result = _userApplication.CanChangePassword(data);

            var message = result.Message;

            if (result.IsSucceeded)
            {
                var id = _userApplication.GetUserIdBy(data.Username);
                return(RedirectToPage("ChangePassword", new { id }));
            }

            return(RedirectToPage("ForgetPassword", new { message, color = "danger" }));
        }