public virtual async Task <User> RegisterUser(User userToRegister, string password)
        {
            var existingUser = await _userManager.FindByNameAsync(userToRegister.Login.ToLower());

            if (existingUser != null)
            {
                var removed = await RemoveNonActivatedUser(existingUser);

                if (!removed)
                {
                    throw new LoginAlreadyUsedException();
                }
            }

            existingUser = _userManager.Users.FirstOrDefault(it => it.Email == userToRegister.Email);
            if (existingUser != null)
            {
                var removed = await RemoveNonActivatedUser(existingUser);

                if (!removed)
                {
                    throw new EmailAlreadyUsedException();
                }
            }

            var newUser = new User
            {
                Login = userToRegister.Login,
                // new user gets initially a generated password
                PasswordHash = _passwordHasher.HashPassword(null, password),
                FirstName    = userToRegister.FirstName,
                LastName     = userToRegister.LastName,
                Email        = userToRegister.Email.ToLowerInvariant(),
                ImageUrl     = userToRegister.ImageUrl,
                LangKey      = userToRegister.LangKey,
                // new user is not active
                Activated = false,
                // new user gets registration key
                ActivationKey = RandomUtil.GenerateActivationKey()
                                //TODO manage authorities
            };
            await _userManager.CreateAsync(newUser);

            _log.LogDebug($"Created Information for User: {newUser}");
            return(newUser);
        }