Title: Error (@websanova/vue-auth): drivers/http/axios.js: http plugin has not been set
Tags: javascript;laravel;vue.js;authentication
Question: I'm trying to setup vue-auth into my laravel-vue application.
But I'm getting console errors as
Error (@websanova/vue-auth): drivers/http/axios.js: http plugin has not been set.
Uncaught TypeError: this.plugins.http is undefined
and this is my app.js file content
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://151.154.11.224:8000'
Vue.config.performance = true
Vue.use(CoreuiVue)
Vue.use(VueAuth,auth)
new Vue({
el: '#app',
router,
store,
icons,
template: '<App/&gt;',
components: {
App
and auth.js content
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 some of this options
// can be override in method calls
const config = {
plugins: {
http: Vue.axios, // Axios
router: Vue.router,
},
drivers: {
auth: bearer,
http: axios,
router: router,
tokenDefaultName: 'token',
tokenStore: ['localStorage'],
rolesVar: 'role',
// registerData: {url: 'auth/register', method: 'POST', redirect: '/login'},
loginData: {url: 'login', method: 'POST', redirect: '/dashboard', fetchUser: true},
logoutData: {url: 'logout', method: 'POST', redirect: '/login', makeRequest: true},
fetchData: {url: 'user', method: 'GET', enabled: true},
refreshData: {url: 'refresh', method: 'GET', enabled: true, interval:30 },
authRedirect: { path: '/' },
parseUserData(response){
let data = response.data;
data.refresh = response.refresh_token;
localStorage.setItem(&quot;user&quot;, JSON.stringify(data));
return data;
options: {
rolesKey: 'type',
notFoundRedirect: {name: 'user-account'},
export default config
and I followed this tutorial https://websanova.com/docs/vue-auth/guides/startup to setup.
please help me to find what i am doing wrong.
Laravel Framework 8.6.0 and vue&quot;: &quot;^2.5.17&quot;.
Thanks in advance.


Here is another answer: I could find a solution.And this can be solved using https://websanova.com/docs/vue-auth/guides/startup tutorial guides.
After installing the websanova/vue-auth plugin, There are some dependencies that must be set before the plugin is installed
Router
The Vue.router must be set which then corresponds to the router driver installed with the plugin.
An http plugin must be set which then corresponds to the http driver installed with the plugin.
as well as config.
Git: https://github.com/websanova/vue-auth/tree/master/demos/2.x/src
I setup the application as it setup in git main.js file.
And it worked.

{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2021:00:09/24/21', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<javascript><laravel><vue.js><authentication>', 'Title': 'Error (@websanova/vue-auth): drivers/http/axios.js: http plugin has not been set', 'ViewCount': 564, 'id': 69309797, 'user_AboutMe': '<p>I am a software engineer for 4 years now.</p>\n<p>Needless to say, the following is as optional as optional can be on a site built on volunteer contributions, but if you\'d like to say thanks for answers that helped you, you can\n\n<img src="https://i.stack.imgur.com/WcL4L.png" alt="Buy me a coffee"></p>\n', 'user_AccountId': 9259987.0, 'user_DisplayName': 'Rishni Meemeduma', 'user_Reputation': 233.0, 'user_Views': 32.0, 'user_id': 9779552.0}}