{"size": 1231, "ext": "js", "max_stars_repo_path": "recipebookclient/src/main.js", "max_stars_repo_name": "jvallon/recipe-book", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "recipebookclient/src/main.js", "max_issues_repo_name": "jvallon/recipe-book", "max_issues_repo_issues_event_min_datetime": "2021-06-14T02:48:34.000Z", "max_issues_repo_issues_event_max_datetime": "2021-06-14T02:48:53.000Z", "max_forks_repo_path": "recipebookclient/src/main.js", "max_forks_repo_name": "jvallon/recipe-book", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 2, "max_forks_count": null, "avg_line_length": 23.6730769231, "max_line_length": 65, "alphanum_fraction": 0.6937449228}
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import vuetify from './plugins/vuetify'
import Axios from 'axios'

import { Auth0Plugin, getInstance } from './auth'
import { domain, clientId, audience } from '../auth_config.json'
Vue.config.productionTip = false

Axios.defaults.baseURL = process.env.VUE_APP_API_ENDPOINT

Vue.use(Auth0Plugin, {
  domain,
  clientId,
  audience,
  onRedirectCallback: appState => {
    router.push(
      appState && appState.targetUrl
        ? appState.targetUrl
        : window.location.pathname
    )
  }
})

const instance = getInstance()

instance.$watch('loading', async loading => {
  if (!loading && instance.isAuthenticated) {
    console.log('UPDATING TOKEN')
    Vue.prototype.$token = await instance.getTokenSilently()
    Vue.prototype.$userId = instance.user.sub.split('|')[1]
  }
})

// Add a request interceptor
Axios.interceptors.request.use(function (config) {
  config.headers.Authorization = `Bearer ${Vue.prototype.$token}`
  return config
}, function (error) {
  // Do something with request error
  return Promise.reject(error)
})

new Vue({
  router,
  store,
  vuetify,
  render: h => h(App)
}).$mount('#app')
