feat: auth jwt, permissions, login ui (wip)

This commit is contained in:
Nicolas Giard
2018-10-08 00:17:31 -04:00
parent 563d1a4f98
commit 3abd2f917c
53 changed files with 550 additions and 438 deletions

View File

@@ -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)
}