1、根據帳號取出來當前用戶的實體ide
var userMgr = scope.ServiceProvider.GetRequiredService<UserManager<ApplicationUser>>(); var userModel = userMgr.FindByNameAsync(account).Result;
2、修改密碼ui
string code = userMgr.GeneratePasswordResetTokenAsync(userModel).Result; var result = userMgr.ResetPasswordAsync(userModel, code, password);