From 96864eed93b932e88dc661c1dd746b512317f563 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Sun, 7 Sep 2025 22:37:21 +0100 Subject: [PATCH] Password reset --- .../Accounting/AccountController.cs | 18 +++++++++++++----- src/Yavsc/Views/Account/ResetPassword.cshtml | 5 ++++- .../ResetPasswordConfirmation fr.cshtml | 7 +++++++ .../Account/ResetPasswordConfirmation.cshtml | 8 ++++++++ 4 files changed, 32 insertions(+), 6 deletions(-) create mode 100755 src/Yavsc/Views/Account/ResetPasswordConfirmation fr.cshtml create mode 100755 src/Yavsc/Views/Account/ResetPasswordConfirmation.cshtml diff --git a/src/Yavsc/Controllers/Accounting/AccountController.cs b/src/Yavsc/Controllers/Accounting/AccountController.cs index 2bcda6a2..a471cd64 100644 --- a/src/Yavsc/Controllers/Accounting/AccountController.cs +++ b/src/Yavsc/Controllers/Accounting/AccountController.cs @@ -894,8 +894,7 @@ namespace Yavsc.Controllers var code = await _userManager.GeneratePasswordResetTokenAsync(user); var f = this.HttpContext.Features; var callbackUrl = _siteSettings.ExternalUrl + "/Account/ResetPassword/" + - HttpUtility.UrlEncode(user.Id) + "/" + HttpUtility.UrlEncode(code); - + HttpUtility.UrlEncode(user.Id) + "/" + HttpUtility.UrlEncode(code); var sent = await _emailSender.SendEmailAsync(user.UserName, user.Email, _localizer["Reset Password"], _localizer["Please reset your password by "] + " -

@Model.Email

+

Your email : @Model.Email

+ + @Html.ValidationSummary()
@@ -10,6 +12,7 @@
+ diff --git a/src/Yavsc/Views/Account/ResetPasswordConfirmation fr.cshtml b/src/Yavsc/Views/Account/ResetPasswordConfirmation fr.cshtml new file mode 100755 index 00000000..ac5b5fca --- /dev/null +++ b/src/Yavsc/Views/Account/ResetPasswordConfirmation fr.cshtml @@ -0,0 +1,7 @@ +@{ + ViewData["Title"] = "Reset password confirmation"; +} + +

@ViewData["Title"].

+

Votre mot de passe a été ré-initialisé. +Cliquez ici pour vous connecter.

diff --git a/src/Yavsc/Views/Account/ResetPasswordConfirmation.cshtml b/src/Yavsc/Views/Account/ResetPasswordConfirmation.cshtml new file mode 100755 index 00000000..02f505d2 --- /dev/null +++ b/src/Yavsc/Views/Account/ResetPasswordConfirmation.cshtml @@ -0,0 +1,8 @@ +@{ + ViewData["Title"] = "Reset password confirmation"; +} + +

@ViewData["Title"].

+

+ Your password has been reset. Please Click here to log in. +