manchenkoff / nuxt-auth-sanctum

Nuxt module for Laravel Sanctum authentication
https://manchenkoff.gitbook.io/nuxt-auth-sanctum/
MIT License
173 stars 21 forks source link

Intercept the user endpoint response #193

Closed tiagomatosweb closed 1 month ago

tiagomatosweb commented 1 month ago

Hi, I was just wondering if there is a way to interact/intercept the endpoints.user endpoint so that I can customise (right after the fetch) what should be available in the composable useSanctumUser.

For example, my endpoints.user endpoint returns

{
id: 10,
name: 'Jon',
age: 30
}

But I want to make available in the composer only

{
id: 10,
name: 'Jon',
}

Removing the age.

Of course, it was just an hypothetical example.

Great plugin