From 1625ca3d2f7a5de575ffc2ef8830af0967f08e11 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Thu, 21 Jul 2016 12:16:14 +0200 Subject: [PATCH] activates the "forgotten password" feature --- Yavsc/Controllers/AccountController.cs | 10 +++++----- Yavsc/Views/Account/ForgotPassword.cshtml | 7 ++----- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/Yavsc/Controllers/AccountController.cs b/Yavsc/Controllers/AccountController.cs index 269334b2..5cd89538 100644 --- a/Yavsc/Controllers/AccountController.cs +++ b/Yavsc/Controllers/AccountController.cs @@ -334,11 +334,11 @@ namespace Yavsc.Controllers // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 // Send an email with this link - //var code = await _userManager.GeneratePasswordResetTokenAsync(user); - //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Reset Password", - // "Please reset your password by clicking here: link"); - //return View("ForgotPasswordConfirmation"); + var code = await _userManager.GeneratePasswordResetTokenAsync(user); + var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); + await _emailSender.SendEmailAsync(_siteSettings,_smtpSettings,model.Email, "Reset Password", + "Please reset your password by clicking here: link"); + return View("ForgotPasswordConfirmation"); } // If we got this far, something failed, redisplay form diff --git a/Yavsc/Views/Account/ForgotPassword.cshtml b/Yavsc/Views/Account/ForgotPassword.cshtml index 10697c3f..b7b27c8d 100755 --- a/Yavsc/Views/Account/ForgotPassword.cshtml +++ b/Yavsc/Views/Account/ForgotPassword.cshtml @@ -4,11 +4,8 @@ }

@ViewData["Title"].

-

- For more information on how to enable reset password please see this article. -

-@*
+

Enter your email.


@@ -24,7 +21,7 @@ -
*@ + @section Scripts { @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); }