coba deprecated

This commit is contained in:
Irwan Cahyono 2025-08-07 14:00:59 +07:00
parent 5c4bbf3414
commit 537dfcfb34

View File

@ -1,5 +1,4 @@
import { defineStore } from 'pinia'; import { defineStore } from 'pinia';
import { isServer } from '#imports'
export const useAuthStore = defineStore('auth', () => { export const useAuthStore = defineStore('auth', () => {
const accessToken = useCookie('access_token', { const accessToken = useCookie('access_token', {
@ -43,8 +42,7 @@ export const useAuthStore = defineStore('auth', () => {
} }
const fetchUser = async () => { const fetchUser = async () => {
if (isServer) return; if (process.server || !accessToken.value) return;
if (!accessToken.value) return
try { try {
const data = await $fetch(`${config.public.apiBase}/auth/users/me/`, { const data = await $fetch(`${config.public.apiBase}/auth/users/me/`, {
headers: { headers: {