Hola, realizo la autenticación vue con jwt y vuex, y funciona bien, pero necesito cargar el token y el usuario cuando actualizo la página. encuentro en línea este código store.dispatch('auth/attemptAuthtoken', localStorage.getItem('authToken')) y funciona bien pero solo funciona en main.js. Necesito ponerlo en index.js (archivo principal de la tienda), pero si lo uso, tengo un problema con la tienda/despacho, etc.
Intento importar la tienda pero también tengo un problema.

Alguien me puede ayudar a arreglarlo? (Empecé hace muy poco a usar vue/vuex)
principal.js
import { createApp } from 'vue' import App from './App.vue' import router from './router' import axios from 'axios' import store from './store' store.dispatch('auth/attemptAuthtoken', localStorage.getItem('authToken')) store.dispatch('auth/attemptUser', JSON.parse (localStorage.getItem('user'))) axios.defaults.baseURL = 'https://**********/' createApp(App).use(store).use(router).mount('#app')índice.js
import { createStore } from 'vuex' import auth from './auth.js' export default createStore({ state: { }, mutations: { }, actions: { }, modules: { auth } })