S
S
SM_ST2021-07-19 18:04:08
Vue.js
SM_ST, 2021-07-19 18:04:08

How to properly implement authorization on Vue.js + Laravel + JWT?

There is a Laravel + Vue.js project Tell me

how to implement authorization correctly?

This guide is generally incomprehensible to write

import auth                  from '@websanova/vue-auth/dist/v2/vue-auth.esm.js';
import driverAuthBearer      from '@websanova/vue-auth/dist/drivers/auth/bearer.esm.js';
import driverHttpAxios       from '@websanova/vue-auth/dist/drivers/http/axios.1.x.esm.js';
import driverRouterVueRouter from '@websanova/vue-auth/dist/drivers/router/vue-router.2.x.esm.js';

Vue.use(auth, {
  plugins: {
      http: Vue.axios, // Axios
      router: Vue.router,
  },
  drivers: {
      auth: driverAuthBearer,
      http: driverHttpAxios,
      router: driverRouterVueRouter,
  }
});

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

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question