Zeeeth
Explore posts from servers[useFetch] Component is already mounted, please use $fetch instead (in middleware)
i also have separated this into two different middlewares:
* 10.auth.global.ts
* 20.user.global.ts
the auth-middleware handle the authentication and user-middleware make sure the userStore is populated with the current user if the user is authenticated
10 replies
[useFetch] Component is already mounted, please use $fetch instead (in middleware)
Im sorry you havn't gotten any real help.
I do almost the same thing that you do, but i do not use useFetch in my middleware, but $fetch as stated by the warning. What i do to avoid the multi-call is to store the user in a store. You may use the useStore or some other store manager. That way, you can check if the user is already fetched, end if not refresh the user into your store
10 replies
Dynamic route in nuxtRouteMiddleware
for anyone looking into this, i've created a bug-report related: https://github.com/nuxt/nuxt/issues/20491
2 replies