diff --git a/Yavsc/Controllers/AccountController.cs b/Yavsc/Controllers/AccountController.cs
index c292954c..8b73bbd1 100644
--- a/Yavsc/Controllers/AccountController.cs
+++ b/Yavsc/Controllers/AccountController.cs
@@ -15,6 +15,7 @@ using Yavsc.Models;
using Yavsc.Services;
using Yavsc.ViewModels.Account;
using Yavsc.Helpers;
+using Microsoft.Extensions.Localization;
namespace Yavsc.Controllers
{
@@ -30,6 +31,8 @@ namespace Yavsc.Controllers
SmtpSettings _smtpSettings;
TwilioSettings _twilioSettings;
+ IStringLocalizer _localizer;
+
// TwilioSettings _twilioSettings;
public AccountController(
@@ -38,7 +41,8 @@ namespace Yavsc.Controllers
IEmailSender emailSender,
IOptions siteSettings,
IOptions smtpSettings,
- ILoggerFactory loggerFactory, IOptions twilioSettings)
+ ILoggerFactory loggerFactory, IOptions twilioSettings,
+ IStringLocalizer localizer)
{
_userManager = userManager;
_signInManager = signInManager;
@@ -49,6 +53,7 @@ namespace Yavsc.Controllers
_smtpSettings = smtpSettings.Value;
_twilioSettings = twilioSettings.Value;
_logger = loggerFactory.CreateLogger();
+ _localizer = localizer;
}
@@ -335,10 +340,14 @@ namespace Yavsc.Controllers
{
if (ModelState.IsValid)
{
- var user = await _userManager.FindByNameAsync(model.Email);
+ var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null || !(await _userManager.IsEmailConfirmedAsync(user)))
{
// Don't reveal that the user does not exist or is not confirmed
+ if (user == null)
+ _logger.LogWarning($"ForgotPassword: Email {model.Email} not found");
+ else
+ _logger.LogWarning($"ForgotPassword: Email {model.Email} not confirmed");
return View("ForgotPasswordConfirmation");
}
@@ -346,8 +355,8 @@ namespace Yavsc.Controllers
// 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(_siteSettings,_smtpSettings,model.Email, "Reset Password",
- "Please reset your password by clicking here: link");
+ await _emailSender.SendEmailAsync(_siteSettings,_smtpSettings,model.Email, _localizer["Reset Password"],
+ _localizer["Please reset your password by followin this link:"] + callbackUrl );
return View("ForgotPasswordConfirmation");
}
@@ -366,7 +375,7 @@ namespace Yavsc.Controllers
//
// GET: /Account/ResetPassword
[HttpGet]
- public IActionResult ResetPassword(string code = null)
+ public IActionResult ResetPassword(string UserId, string code = null)
{
return code == null ? View("Error") : View();
}
@@ -381,7 +390,7 @@ namespace Yavsc.Controllers
{
return View(model);
}
- var user = await _userManager.FindByNameAsync(model.Email);
+ var user = await _userManager.FindByEmailAsync(model.Email);
if (user == null)
{
// Don't reveal that the user does not exist
diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx
index f0401f82..1d1d1187 100644
--- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx
+++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.en.resx
@@ -251,9 +251,11 @@
PersonPhotoPhoto updated
+ Please check your email to reset your password.Please confirm your new passwordPlease fill in a bodyPlease, fill in a reason
+
PostedPrefered dateprestation
diff --git a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx
index 719872c8..c3f46a15 100644
--- a/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx
+++ b/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.fr.resx
@@ -194,6 +194,7 @@
Date de finHeure de fine-mail
+ Saisissez votre email.entréesEstimerDevis non trouvé
@@ -205,8 +206,8 @@
Veuillez, s'il vous plait, utiliser une date future.Saisissez votre demande de rendez-vousContenu à accès restreint
-
- Mot de passe oublié
+ Mot de passe perdu?
+ Confirmation mot de passe perdu.provenant deL'envoi du message push a échouéMessage push envoyé
@@ -273,9 +274,11 @@
PersonnePhotoPhoto mise à jour
+ S'il vous plait, veuillez verifier votre boite au lettres, pour pouvoir ré-initialiser votre mot de passe.S'il vous plait, veuillez confirmer votre nouveau mot de passe.S'il vous plait, saisissez un corps de messageS'il vous plait, saisissez une réson, un sujet pour votre message
+ Veuillez s'il vous plait utiliser le lien suivant pour ré-initialiser votre mot de passe:PostéDate souhaitéeLieu de la présation: {0}.\n
@@ -297,7 +300,7 @@
SupprimerSupprimer mon profile professionnelRôle
- Ré-initialiser votre mot de passe
+ Ré-initialiser votre mot de passeRôle crééNom du rôle Save these settings
@@ -357,5 +360,4 @@
Vos publicationsVotre profileVotre messge a été envoyé
-
diff --git a/Yavsc/Views/Account/ForgotPassword.cshtml b/Yavsc/Views/Account/ForgotPassword.cshtml
index b7b27c8d..93e0276b 100755
--- a/Yavsc/Views/Account/ForgotPassword.cshtml
+++ b/Yavsc/Views/Account/ForgotPassword.cshtml
@@ -1,12 +1,12 @@
@model ForgotPasswordViewModel
@{
- ViewData["Title"] = "Forgot your password?";
+ ViewData["Title"] = SR["Forgot your password?"];
}
-
- Please check your email to reset your password.
+ @SR["PleaseCheckYourEmail"]
diff --git a/Yavsc/Views/Shared/SignIn.cshtml b/Yavsc/Views/Shared/SignIn.cshtml
index 468b07fe..1583ffb4 100644
--- a/Yavsc/Views/Shared/SignIn.cshtml
+++ b/Yavsc/Views/Shared/SignIn.cshtml
@@ -45,7 +45,7 @@
@SR["Register as a new user"]?