Add TenantId to ResetPasswordDto

pull/9277/head
liangshiwei 4 years ago
parent c2f958d010
commit f843a679b2

@ -8,6 +8,8 @@ namespace Volo.Abp.Account
{
public Guid UserId { get; set; }
public Guid? TenantId { get; set; }
[Required]
public string ResetToken { get; set; }

@ -62,16 +62,19 @@ namespace Volo.Abp.Account
public virtual async Task ResetPasswordAsync(ResetPasswordDto input)
{
await IdentityOptions.SetAsync();
using (CurrentTenant.Change(input.TenantId))
{
await IdentityOptions.SetAsync();
var user = await UserManager.GetByIdAsync(input.UserId);
(await UserManager.ResetPasswordAsync(user, input.ResetToken, input.Password)).CheckErrors();
var user = await UserManager.GetByIdAsync(input.UserId);
(await UserManager.ResetPasswordAsync(user, input.ResetToken, input.Password)).CheckErrors();
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = IdentitySecurityLogIdentityConsts.Identity,
Action = IdentitySecurityLogActionConsts.ChangePassword
});
await IdentitySecurityLogManager.SaveAsync(new IdentitySecurityLogContext
{
Identity = IdentitySecurityLogIdentityConsts.Identity,
Action = IdentitySecurityLogActionConsts.ChangePassword
});
}
}
protected virtual async Task<IdentityUser> GetUserByEmail(string email)

@ -67,17 +67,15 @@ namespace Volo.Abp.Account.Web.Pages.Account
try
{
using (CurrentTenant.Change(TenantId))
{
await AccountAppService.ResetPasswordAsync(
new ResetPasswordDto
{
UserId = UserId,
ResetToken = ResetToken,
Password = Password
}
);
}
await AccountAppService.ResetPasswordAsync(
new ResetPasswordDto
{
UserId = UserId,
ResetToken = ResetToken,
Password = Password,
TenantId = TenantId
}
);
}
catch (AbpIdentityResultException e)
{

Loading…
Cancel
Save