Ejemplo n.º 1
0
 public IActionResult ForgotPassword(ForgotPasswordViewModel model)
 {
     //Sends the Reset Link to the user's email
     if (_context.SendResetLink(model))
     {
         //Initializes Viewbag so it will display on the View.
         ViewBag.Message         = "Email sent, check your email for future instructions.";
         TempData["ForgotEmail"] = model.UserEmail;
         _context.LogAction("Forgot Password", "Reset link sent to user's email.", _context.GetUserByEmail(model.UserEmail));
         return(View());
     }
     else
     {
         ViewBag.Message = "Email does not exist. Please try again.";
         return(View());
     }
 }