26 lines
583 B
JavaScript
Executable File
26 lines
583 B
JavaScript
Executable File
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
import './assets/main.css'
|
|
|
|
const app = createApp(App)
|
|
const pinia = createPinia()
|
|
|
|
app.use(pinia)
|
|
app.use(router)
|
|
|
|
// Session beim App-Start wiederherstellen
|
|
import { useAuthStore } from './stores/authStore'
|
|
const authStore = useAuthStore()
|
|
|
|
// Versuche Token aus localStorage zu laden
|
|
if (authStore.loadToken()) {
|
|
authStore.fetchCurrentUser().catch(err => {
|
|
console.error('Session-Wiederherstellung fehlgeschlagen:', err)
|
|
})
|
|
}
|
|
|
|
app.mount('#app')
|
|
|