diff --git a/Makefile b/Makefile index 726d056a..8ae711c4 100644 --- a/Makefile +++ b/Makefile @@ -9,7 +9,7 @@ stop: ## Stop Wiki.js restart: ## Restart Wiki.js node wiki restart -dev: ## Start Wiki.js in development mode +dev-up: ## Start Wiki.js in development mode node wiki dev build: ## Build Wiki.js client assets diff --git a/client/client-app.js b/client/client-app.js index 39d5f3ba..7fe8c56b 100644 --- a/client/client-app.js +++ b/client/client-app.js @@ -22,6 +22,7 @@ import VueMoment from 'vue-moment' import VueTour from 'vue-tour' import VueTreeNavigation from 'vue-tree-navigation' import store from './store' +import Cookies from 'js-cookie' // ==================================== // Load Modules @@ -74,7 +75,10 @@ const graphQLLink = createPersistedQueryLink().concat( options.body = JSON.stringify(body) // Inject authentication token - options.headers.Authorization = `Bearer TODO` + const jwtToken = Cookies.get('jwt') + if (jwtToken) { + options.headers.Authorization = `Bearer ${jwtToken}` + } return fetch(uri, options) } diff --git a/client/components/common/nav-footer.vue b/client/components/common/nav-footer.vue index c4d6a94c..0322c8e7 100644 --- a/client/components/common/nav-footer.vue +++ b/client/components/common/nav-footer.vue @@ -1,14 +1,14 @@ @@ -111,6 +111,7 @@