Skip to content

Commit

Permalink
feat(api-key): send api key to with requests
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Jan 17, 2025
1 parent 577e99c commit abe1854
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ export const $axios2 = axios.create({
const $auth = localStorageCache(0, 'app').get('auth')
const initUser = $auth ? $auth.data : undefined
if (initUser) { $axios2.defaults.headers.common['Authorization'] = `BEARER ${initUser.token}` }

$axios2.defaults.headers.common['api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY

/* provided methods */
const $http = (path, opts, handleErrors) => {
opts = opts || {}
Expand Down

0 comments on commit abe1854

Please sign in to comment.