<commit_before>import axios from 'axios'

// const baseUrl = 'https://apis.voicebase.com/v2-beta';
const baseUrl = 'http://localhost:8080/auth0demo/api/token';

export default {
  createKey(token) {
    let url = `${baseUrl}`;
    return axios.get(url, {
      headers: {
        Authorization: 'Bearer ' + token
      }
    })
    .then(response => {
      const apiKey = response.data.apiToken;
      const returnedObject = { apiKey };
      return returnedObject;
    })
    .catch(error => {
      if (error.data && error.data.errors) {
        error = error.data.error;
      }
      return Promise.reject(error);
    });
  }
}<commit_msg>Token creation now points to dev environment.<commit_after>import axios from 'axios'

// Auth0 prototype
// const baseUrl = 'https://apis.voicebase.com/v2-beta';
const baseUrl = 'https://apis.dev.voicebase.com/v2-beta/profile/keys';
// const baseUrl = 'http://localhost:10080/v2-beta/profile/keys';

export default {
  createKey(token) {
    let url = `${baseUrl}`;
    return axios.post(url, null, {
      headers: {
        Authorization: 'Bearer ' + token
      }
    })
    .then(response => {
      const apiKey = response.data.key.bearerToken;
      const returnedObject = { apiKey };
      return returnedObject;
    })
    .catch(error => {
      if (error.data && error.data.errors) {
        error = error.data.error;
      }
      return Promise.reject(error);
    });
  }
}
{'fraction_non_alphanumeric': 0.1497550734779566, 'fraction_numerical': 0.010496850944716585, 'mean_word_length': 2.5049019607843137, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2090003', 'n_tokens_mistral': 468, 'n_tokens_neox': 462, 'n_words': 90}