Understanding useSession behavior in Nuxt with Better-Auth and NuxtUI
I'm using Better-Auth for authentication and ran into some confusion while trying to implement a simple feature: showing a Login button in the menu when the user is not authenticated, and Sign Out when they are. I'm also using NuxtUI for the UI components.
After a lot of trial and error, I got it working with the code below, but I got questions:
1. Why does using await to useSession() fix it?
2. Would it make sense to disable SSR for this component to simplify or optimize things?
After a lot of trial and error, I got it working with the code below, but I got questions:
1. Why does using await to useSession() fix it?
2. Would it make sense to disable SSR for this component to simplify or optimize things?
