Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

rafidAhsan's avatar

Nuxtjs data is not fetching

This is my simple composable for having user data after login

const user = await useLazyAsyncData('user', () => 
        $fetch(api()+'/auth/user', {
            headers: userStore.getToken()
        })
    )

auth token is working but it gets will null in user.data.value

_rawValue: null
_value: null

But on postman api is working

0 likes
0 replies

Please or to participate in this conversation.