2FAuth/resources/js/packages/axios.js
2020-01-16 13:50:53 +01:00

15 lines
330 B
JavaScript
Vendored

import Vue from 'vue'
import router from '../routes/routes'
axios.interceptors.request.use(request => {
const token = localStorage.getItem('jwt')
if(token) {
request.headers.common['Authorization'] = 'Bearer ' + token
}
request.headers.common['Content-Type'] = 'application/json'
return request
})