I've been working on integrating vue-auth into my laravel-vue application, but I'm encountering some console errors:
Error (@websanova/vue-auth): drivers/http/axios.js: http plugin has not been set.
Uncaught TypeError: this.plugins.http is undefined.
Below is the content of my app.js:
import 'core-js/stable'
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import VueAxios from 'vue-axios'
import CoreuiVue from '@coreui/vue'
import { iconsSet as icons } from './assets/icons/icons.js'
import store from './store'
import VueAuth from '@websanova/vue-auth/dist/v2/vue-auth.esm.js';
import auth from './auth';
Vue.prototype.$apiAdress = 'http://127.0.0.1:8000'
Vue.config.performance = true
Vue.use(CoreuiVue)
Vue.use(VueAuth,auth)
new Vue({
el: '#app',
router,
store,
icons,
template: '<App/>',
components: {
App
},
})
Additionally, here is the content of my auth.js:
import Vue from 'vue'
import bearer from '@websanova/vue-auth/dist/drivers/auth/bearer.esm'
import axios from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm';
import router from '@websanova/vue-auth/dist/drivers/router/vue-router.2.x.esm';
// Auth base configuration with various options
const config = {
plugins: {
http: Vue.axios,
router: Vue.router,
},
drivers: {
auth: bearer,
http: axios,
router: router,
tokenDefaultName: 'token',
tokenStore: ['localStorage'],
rolesVar: 'role',
// Other configurations go here...
}
export default config
I have been following the tutorial at for guidance. Any help in identifying what I might be doing wrong would be greatly appreciated. Laravel Framework 8.6.0 and vue": "^2.5.17".
Thank you in advance.