Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

361
Vistas
Error (@websanova/vue-auth): drivers/http/axios.js: http plugin has not been set

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://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
  },
})

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("user", 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": "^2.5.17".

Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

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.

HTTP

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.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda