What problem does it solve?
This Skill simplifies and secures authentication flows in Nuxt applications, providing essential tools for user management, route protection, and integration with various auth providers.
Core Features & Use Cases
- User Session Management: Provides composables like
useUserSession for client-side access to user data and authentication status.
- Server-Side Protection: Offers utilities like
requireUserSession to protect API routes and server endpoints.
- Route Protection: Enables route-level authentication rules via
nuxt.config.ts and definePageMeta.
- Plugin Integration: Seamlessly integrates with Better Auth plugins for features like admin roles, two-factor authentication, and passkeys.
- Use Case: Securely protect your
/admin routes for administrators only, allow any logged-in user into /dashboard, and redirect unauthenticated users from /login to /.
Quick Start
Configure your Nuxt application to protect the /admin route for users with the 'admin' role.