<commit_before>angular.module('app')

  .service(
  "SyncService",
  function($http, $q) {

    // Return public API.
    return({
      authenticateUser: authenticateUser,
      createFeature: createFeature,
      updateFeature: updateFeature,
      getDatasets: getDatasets,
      createDataset: createDataset,
      deleteDataset: deleteDataset,
      addSpotToDataset: addSpotToDataset,
      deleteAllDatasetSpots: deleteAllDatasetSpots,
      addDatasetSpot: addDatasetSpot,
      getDatasetSpots: getDatasetSpots,
      deleteSpots: deleteSpots,
      uploadImage: uploadImage,
      getImages: getImages,
      downloadImage: downloadImage
    });

    // ---
    // Public Methods
    // ---

    // Authenticate the user
    function authenticateUser(loginData) {
      var request = $http({
        method: "post",
        url: "http://strabospot.org/userAuthenticate",
        headers: {
          'Content-Type': 'application/json'
        },
        data:
          loginData
      });
      return(request.then(handleSuccess, handleError));
    }

    // Create a new feature
    function createFeature(spot, encodedLogin) {
      var request = $http({
        method: "post",
        url: "http://strabospot.org/db/feature",
        headers: {
          'Authorization': "Basic " + encodedLogin,
          'Content-Type': 'application/json'
        },
        data:
          spot
      });
      return(request.then(handleSuccess, handleError));
    }<commit_msg>login email should be case insensitive<commit_after>angular.module('app')

  .service(
  "SyncService",
  function($http, $q) {

    // Return public API.
    return({
      authenticateUser: authenticateUser,
      createFeature: createFeature,
      updateFeature: updateFeature,
      getDatasets: getDatasets,
      createDataset: createDataset,
      deleteDataset: deleteDataset,
      addSpotToDataset: addSpotToDataset,
      deleteAllDatasetSpots: deleteAllDatasetSpots,
      addDatasetSpot: addDatasetSpot,
      getDatasetSpots: getDatasetSpots,
      deleteSpots: deleteSpots,
      uploadImage: uploadImage,
      getImages: getImages,
      downloadImage: downloadImage
    });

    // ---
    // Public Methods
    // ---

    // Authenticate the user
    function authenticateUser(loginData) {
      var request = $http({
        method: "post",
        url: "http://strabospot.org/userAuthenticate",
        headers: {
          'Content-Type': 'application/json'
        },
        data: {
          email: loginData.email.toLowerCase(),
          password: <PASSWORD>
        }
      });
      return(request.then(handleSuccess, handleError));
    }

    // Create a new feature
    function createFeature(spot, encodedLogin) {
      var request = $http({
        method: "post",
        url: "http://strabospot.org/db/feature",
        headers: {
          'Authorization': "Basic " + encodedLogin,
          'Content-Type': 'application/json'
        },
        data:
          spot
      });
      return(request.then(handleSuccess, handleError));
    }
{'fraction_non_alphanumeric': 0.11158376963350786, 'fraction_numerical': 0.0, 'mean_word_length': 2.2835660580021484, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2111701', 'n_tokens_mistral': 866, 'n_tokens_neox': 869, 'n_words': 172}