public IActionResult Index() { var model = _configuration.GetConfiguration(); if (model == null) { _configuration.SetConfiguration(); model = _configuration.GetConfiguration(); } return(View(model)); }
public IActionResult ForgotPassword(ForgotPasswordViewModel model) { if (ModelState.IsValid) { var user = userRepository.GetUserByEmail(model.Email); if (user == null) { ModelState.AddModelError("", "Email not exists !"); return(View()); } else { string token = SecurityManager.GenerateToken(user.Id, user.UserName, Request.Headers["User-Agent"].ToString()); var passwordResetLink = Url.Action("ResetPassword", "Login", new { email = user.Email, token = token }, Request.Scheme); mailer.SendEmail(passwordResetLink, user.Email, "Reset Password", "Please click this link to comfirmation to " + "Reset your password: "******"_confirmEmail")); } } return(View()); }