Всё настраивается нормально, документация говно прост.
Vue.use(VueAuth, {
auth: require('./components/auth'),
http: require('@websanova/vue-auth/drivers/http/axios.1.x.js'),
router: require('@websanova/vue-auth/drivers/router/vue-router.2.x.js'),
rolesVar: 'role',
loginData: {url: '/api-token-auth/', method: 'POST', redirect: '/somepage', fetchUser: true},
fetchData: {url: '/users/me/', method: 'GET', enabled: true},
refreshData: {url: '/users/me/', method: 'GET', enabled: true, interval: 5},
parseUserData: function(res) { return res; },
logoutData: {url: 'auth/logout', method: 'POST', redirect: '/login', makeRequest: false},
});
components/auth.js
module.exports = {
request: function (req, token) {
this.options.http._setHeaders.call(this, req, { Authorization: 'Token ' + token });
},
response: function (res) {
let token = res.data.token
if (token) {
return token;
}
}
};