prerender

This commit is contained in:
Irwan Cahyono 2025-08-07 13:50:58 +07:00
parent 508ea2bb9e
commit 5c4bbf3414

View File

@ -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/`, {