Corrige le mot de passe perdu d'un utilisateur au nom contenant des espaces
This commit is contained in:
@ -9,6 +9,10 @@ namespace Yavsc.Auth {
|
||||
|
||||
public class UserTokenProvider : Microsoft.AspNet.Identity.IUserTokenProvider<ApplicationUser>
|
||||
{
|
||||
private MonoDataProtector protector=null;
|
||||
public MonoDataProtector Protector {
|
||||
get { return protector; }
|
||||
}
|
||||
|
||||
public Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<ApplicationUser> manager, ApplicationUser user)
|
||||
{
|
||||
@ -27,12 +31,13 @@ namespace Yavsc.Auth {
|
||||
{
|
||||
var por = new MonoDataProtector(Constants.ApplicationName,new string[] { purpose } );
|
||||
var userStamp = por.Unprotect(token);
|
||||
string [] values = userStamp.Split(' ');
|
||||
Console.WriteLine ("Unprotected: "+userStamp);
|
||||
string [] values = userStamp.Split(';');
|
||||
return Task.FromResult ( user.Id == values[0] && user.Email == values[1] && user.UserName == values[2]);
|
||||
}
|
||||
|
||||
public static string UserStamp(ApplicationUser user) {
|
||||
return $"{user.Id} {user.Email} {user.UserName}";
|
||||
return $"{user.Id};{user.Email};{user.UserName}";
|
||||
}
|
||||
}
|
||||
}
|
@ -42,7 +42,7 @@ namespace Yavsc.Controllers
|
||||
IOptions<SiteSettings> siteSettings,
|
||||
IOptions<SmtpSettings> smtpSettings,
|
||||
ILoggerFactory loggerFactory, IOptions<TwilioSettings> twilioSettings,
|
||||
IStringLocalizer localizer)
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer)
|
||||
{
|
||||
_userManager = userManager;
|
||||
_signInManager = signInManager;
|
||||
@ -356,7 +356,7 @@ namespace Yavsc.Controllers
|
||||
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, _localizer["Reset Password"],
|
||||
_localizer["Please reset your password by followin this link:"] + callbackUrl );
|
||||
_localizer["Please reset your password by following this link:"] + callbackUrl );
|
||||
return View("ForgotPasswordConfirmation");
|
||||
}
|
||||
|
||||
|
@ -162,6 +162,8 @@
|
||||
<data name="Ciffer"><value>Chiffre</value></data>
|
||||
<data name="Circles"><value>Cercles</value></data>
|
||||
<data name="Click action"><value>Action sur click</value></data>
|
||||
<data name="Click here to log in"><value>Cliquez ici pour vous identifier</value></data>
|
||||
|
||||
<data name="Comment"><value>Commentaire</value></data>
|
||||
<data name="Consultant"><value>Consultant</value></data>
|
||||
<data name="ContactAPerformer"><value>Contactez un préstataire</value></data>
|
||||
@ -274,6 +276,7 @@
|
||||
<data name="Person"><value>Personne</value></data>
|
||||
<data name="Photo"><value>Photo</value></data>
|
||||
<data name="PhotoUpdated"><value>Photo mise à jour</value></data>
|
||||
<data name="Please"><value>S'il vous plait</value></data>
|
||||
<data name="PleaseCheckYourEmail"><value>S'il vous plait, veuillez verifier votre boite au lettres, pour pouvoir ré-initialiser votre mot de passe.</value></data>
|
||||
<data name="PleaseConfirmYourNewPassword"><value>S'il vous plait, veuillez confirmer votre nouveau mot de passe.</value></data>
|
||||
<data name="PleaseFillInABody"><value>S'il vous plait, saisissez un corps de message</value></data>
|
||||
@ -301,6 +304,7 @@
|
||||
<data name="Remove my professional profile"><value>Supprimer mon profile professionnel</value></data>
|
||||
<data name="Role"><value>Rôle</value></data>
|
||||
<data name="Reset Password"><value>Ré-initialiser votre mot de passe</value></data>
|
||||
<data name="Reset password confirmation"><value>Confirmation de ré-initialiser du mot de passe</value></data>
|
||||
<data name="role created"><value>Rôle créé</value></data>
|
||||
<data name="RoleName"><value>Nom du rôle </value></data>
|
||||
<data name="Save these settings"><value>Save these settings</value></data>
|
||||
@ -352,6 +356,8 @@
|
||||
à un préstataire.</value></data>
|
||||
<data name="younotadmin"><value>Vous n'êtes pas administrateur</value></data>
|
||||
<data name="Your book query"><value>Votre demande de rendez-vous</value></data>
|
||||
<data name="Your password has been reset."><value>Votre mote de passe a été mis à jour.</value></data>
|
||||
|
||||
<data name="YourEstimates"><value>Vos Devis</value></data>
|
||||
<data name="YourMEACode"><value>Votre activité</value></data>
|
||||
<data name="YourNeed"><value>Votre besoin</value></data>
|
||||
|
@ -1,8 +1,8 @@
|
||||
@{
|
||||
ViewData["Title"] = "Reset password confirmation";
|
||||
ViewData["Title"] = SR["Reset password confirmation"];
|
||||
}
|
||||
|
||||
<h1>@ViewData["Title"].</h1>
|
||||
<p>
|
||||
Your password has been reset. Please <a asp-controller="Account" asp-action="Login">Click here to log in</a>.
|
||||
@SR["Your password has been reset."] @SR["Please"] <a href="~/signin">@SR["Click here to log in"]</a>.
|
||||
</p>
|
||||
|
Reference in New Issue
Block a user