When a user logs in, I need to store their data for future use. I have middleware set up on the "/page" page to check if the user is logged in, and if so, it allows them through. However, I notice that the user data is lost when the page is refreshed. In this case, if a user refreshes the "/page" page quickly in Nuxt3, there isn't enough time to make a request, so the user may be temporarily unauthorized until they are authorized again. Is there a storage solution that can help with this issue? Any guidance on how to achieve this would be greatly appreciated.
I attempted to use localStorage, but Nuxt3 didn't retrieve the user data quickly enough.