<template>
  <router-view />
</template>
<script setup>
import { onMounted } from 'vue'
import { useAuthStore } from '@/stores/auth'

const auth = useAuthStore()

onMounted(async () => {
  if (localStorage.getItem('access_token') && !auth.user) {
    try { await auth.fetchMe() } catch { /* token expired, ignore */ }
  }
})
</script>
