-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Hi there!
I'm trying to use your plugin to implement JWT authentication and consume REST APIs served by Django.
First of all I'm a rookie in JavaScript and in Vue...
I'm using Vue 3.2.13
my main.js
file:
import { createApp } from 'vue'
import App from '@/App.vue'
import router from '@/router'
import store from '@/store'
import vuetify from '@/plugins/vuetify'
import { loadFonts } from '@/plugins/webfontloader'
import axios from 'axios'
import VueAxios from 'vue-axios'
import Auth from '@gravitano/vue-auth'
loadFonts()
const app = createApp(App)
app.use(router)
app.use(store)
app.use(vuetify)
app.use(VueAxios, axios)
app.use(Auth)
app.mount('#app')
I'm trying to access the global variable $auth
in my Vue components, but it's always undefined
. In template part through {{ $auth.user.name }}
or in script through this.$auth.user.name
.
I also get an error in browser inspect console [Vue warn]: A plugin must either be a function or an object with an "install" function.
and guess it's referred to app.use(Auth)
.
Could you help me?
Metadata
Metadata
Assignees
Labels
No labels