import { defineStore } from 'pinia' export const useAuthStore = defineStore({ id: 'auth', state: () => ({ isAuthenticated: false, user: null }), actions: { async nuxtServerInit() { const user = await this.$axios.get('/api/user') this.$patch({ isAuthenticated: true, user }) } } })