private void SetCredentials(User user, string password)
        {
            var hashedText = _encryptionService.ComputeHash(password);

            user.PasswordSalt      = hashedText.Salt;
            user.Password          = hashedText.Text;
            user.ConfirmationToken = Guid.NewGuid().ToString().ToLower().Replace("-", "");
        }
        public User IsValidLogin(Organization organization, string username, string password)
        {
            User user = FindUser(organization, username);

            if (user != null)
            {
                string hashedPw = _encryptionService.ComputeHash(password, user.PasswordSalt).Text;
                if (hashedPw == user.Password)
                {
                    return(user);
                }
            }

            return(null);
        }