public virtual MailMessage ForgotPassword(ForgotPasswordResetModel model)
        {
            var mailMessage = new MailMessage { Subject = "We found your lost password" };

            mailMessage.To.Add(model.EmailAddress);
            ViewBag.Data = model;
            PopulateBody(mailMessage, viewName: "ForgotPassword");

            return mailMessage;
        }
Beispiel #2
0
        public async Task <ActionResult> ForgotPasswordReset(ForgotPasswordResetModel model)
        {
            var user = await _userManager.FindByEmailAsync(model.Email);

            if (user == null)
            {
                // Don't reveal that the user does not exist
                return(Ok());
            }

            await _userManager.ResetPasswordAsync(user, model.Token, model.Password);

            return(Ok());
        }