dystcz / nuxt-sanctum-auth

Nuxt 3 + laravel sanctum authentication
134 stars 25 forks source link

Refresh user #28

Open cvalues opened 1 year ago

cvalues commented 1 year ago

Hi,

how to refresh the user? To call "await $sanctumAuth.getUser()" again, seems not to make an api call?

KR

kreejzak commented 1 year ago

Hi, only option to refetch user right now is window.location.reload().

cvalues commented 1 year ago

Hi,

my solution now, i change the user data diretyl in the auth.user object after server response.

kreejzak commented 1 year ago

yes, you could do that too, but there is a slight chance that the data would deviate from the source. I so would still recommend refreshing the app after changing user data.

cvalues commented 1 year ago

yeah i know, but i want to avoit a reload in a spa.