Use Nuxt Better Auth session and API patterns
mainWhen building with this template, follow these Nuxt-specific patterns:
- Session Management: Use
useUserSession()to access the shared, SSR-hydrated session. Do not copy the session into another store or a module-levelref. - Data Fetching: The linked-account
useFetchautomatically forwards cookies during SSR and uses a user-specific key. - Server-side Access Control: When creating private API handlers, use
requireUserSession(event)to enforce access on the server. - UI State: Use local
refstate for form inputs. Use action composables to managependinganderrorstates.