diff --git a/stores/auth.ts b/stores/auth.ts index e07fa2a..e470c40 100644 --- a/stores/auth.ts +++ b/stores/auth.ts @@ -1,4 +1,5 @@ import { defineStore } from 'pinia'; +import { isServer } from '#imports' export const useAuthStore = defineStore('auth', () => { const accessToken = useCookie('access_token', { @@ -42,6 +43,7 @@ export const useAuthStore = defineStore('auth', () => { } const fetchUser = async () => { + if (isServer) return; if (!accessToken.value) return try { const data = await $fetch(`${config.public.apiBase}/auth/users/me/`, {