From 5c4bbf3414f8a9c5f5341d3647041b522b240f9b Mon Sep 17 00:00:00 2001 From: Irwan Cahyono Date: Thu, 7 Aug 2025 13:50:58 +0700 Subject: [PATCH] prerender --- stores/auth.ts | 2 ++ 1 file changed, 2 insertions(+) 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/`, {