/**
 * plugins/index.js
 *
 * Automatically included in `./src/main.js`
 */

// Plugins
import vuetify from './vuetify'
import pinia from '../stores'
import router from '../routes/router'

import { useAuthStore } from '../stores/auth' // Importa a store de autenticação

export function registerPlugins(app) {
  app
    .use(vuetify)
    .use(router)
    .use(pinia)

  // Carrega o token do localStorage ao iniciar a aplicação
  const authStore = useAuthStore()
  authStore.loadTokenFromStorage()
}
