public async Task <IActionResult> ResetPasswordPostAsync(string username)
        {
            var user = await GetApplicationUserAsync(username);

            var resetToken = await userManager.GeneratePasswordResetTokenAsync(user);

            var newPassword     = passwordGenerator.GenerateRandomPassword();
            var operationResult = await userManager.ResetPasswordAsync(user, resetToken, newPassword);

            if (operationResult.Succeeded)
            {
                await cachedUserManager.RemoveUserByUserNameAsync(username);

                await emailSender.NotifyUserPasswordResetAsync(user.Email, user.UserName, newPassword);

                return(Ok(new ResetPasswordUsersPostResult()
                {
                    NewPassword = newPassword
                }));
            }
            else
            {
                throw new IdentityOperationException(operationResult.Errors.Select(e => new IdentityOperationExceptionItem(e.Code, e.Description)));
            }
        }