public IActionResult SendEmail(ResetViewModel vm)
        {
            // Get user details from username
            IUser user;
            var   userExists = _context.UserRepository.GetUserIfExists(vm.Username, out user);

            if (!userExists)
            {
                return(RedirectToAction("Index", new { errorMessage = "User with that username does not exist." }));
            }

            // Send email to user

            _passwordResetService.GenerateAndSendToken(user);

            var basevm = _viewModelFactory.Resolve <BaseViewModel>();

            return(View("EmailSentConfirmation", basevm));
        }