Skip to content

Commit 0624a21

Browse files
committed
fix(api-key): attempt to fix api key
1 parent 213e41b commit 0624a21

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ const $auth = localStorageCache(0, 'app').get('auth')
1919
const initUser = $auth ? $auth.data : undefined
2020
if (initUser) { $axios2.defaults.headers.common['Authorization'] = `BEARER ${initUser.token}` }
2121

22-
$axios2.defaults.headers.common['api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY
23-
2422
/* provided methods */
2523
const $http = (path, opts, handleErrors) => {
2624
opts = opts || {}
@@ -57,6 +55,11 @@ const $http2 = (path, opts, handleErrors) => {
5755
const data = opts.data
5856
delete opts.data
5957

58+
$axios2.defaults.headers.common['api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY
59+
$axios2.defaults.headers.common['x-api-key'] = process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY
60+
console.log(process.env.VUE_APP_API_KEY || config.VUE_APP_API_KEY)
61+
$axios2.defaults.withCredentials = true;
62+
6063
let req = (m => {
6164
switch(m) {
6265
case 'post':

0 commit comments

Comments
 (0)