public async Task<ActionResult> ResetPasswordConfirmed(ResetPasswordModel model)
        {
            if (!ModelState.IsValid)
            {
                return View(model);
            }

            _logger.Log(string.Format("ResetPassword request received for user : {0}", model.Email),
                LogCategory.Information, GetUserIdentifiableString(model.Email));

            try
            {
                var currentUser = await UserManager.FindByEmailAsync(model.Email);
                if (currentUser != null)
                {
                    var resultlockedout = await UserManager.IsLockedOutAsync(currentUser.Id);
                    if (resultlockedout)
                    {
                        var result = await UserManager.SetLockoutEnabledAsync(currentUser.Id, false);
                        if (result.Succeeded)
                        {
                            await UserManager.ResetAccessFailedCountAsync(currentUser.Id);
                        }
                    }

                    var resultReset = await UserManager.ResetPasswordAsync(currentUser.Id, model.ResetToken, model.Password);
                    if (!resultReset.Succeeded)
                    {
                        foreach (var error in resultReset.Errors)
                        {
                            ModelState.AddModelError("", error);
                        }
                        return View("ResetPassword", model);
                    }

                }
            }
            catch (Exception ex)
            {
                Trace.WriteLine(ex);
                throw;
            }

            return RedirectPermanent("Login/?userName=" + model.Email);
        }
        public async Task<ActionResult> ResetPassword(string username, string reset)
        {
            try
            {
                Session.Abandon();
                _cookieHelper.ClearAllCookies();
                AuthenticationManager.SignOut();
                if ((reset != null) && (username != null))
                {
                    var currentUser = await UserManager.FindByNameAsync(username);
                    if (currentUser != null)
                    {
                        var model = new ResetPasswordModel() { Email = username, UserType = "Existing", ResetToken = reset};
                        return View("ResetPassword", model);
                    }
                }
            }
            catch (Exception ex)
            {
                Trace.TraceError("Error: Account/SetupPassword exception - {0}", ex);
                throw;
            }

            return RedirectToAction("BadRequest", "Error");
        }