Skip to content

Commit

Permalink
fix(api-key): attempt to fix api key
Browse files Browse the repository at this point in the history
  • Loading branch information
akinsey committed Jan 17, 2025
1 parent 213e41b commit 0624a21
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ 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 Expand Up @@ -57,6 +55,11 @@ const $http2 = (path, opts, handleErrors) => {
const data = opts.data
delete opts.data

$axios2.defaults.headers.common['api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY
$axios2.defaults.headers.common['x-api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY
console.log(process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY)
$axios2.defaults.withCredentials = true;

let req = (m => {
switch(m) {
case 'post':
Expand Down

0 comments on commit 0624a21

Please sign in to comment.