Overview of Nuxt Auth Sanctum features
mainNuxt Auth Sanctum is a Nuxt module that provides a simple, SSR-ready way to integrate Laravel Sanctum authentication into your Nuxt application. It automates several authentication tasks, including CSRF token and cookie management, as well as Bearer token header management.
Key capabilities include:
- Authentication Access: Use the
useSanctumAuthcomposable to access the current user and authentication methods. - Data Fetching: Use
useSanctumFetchanduseLazySanctumFetchto interact with your API while automatically handling authentication headers. - Flexible Modes: Supports both Client-Side Rendering (CSR) and Server-Side Rendering (SSR).
- Security: Automated management of
CSRFtokens andBearertokens. - Extensibility: Includes custom
requestandresponseinterceptors, and allows subscribing tosanctum:*hooks. - Middleware: Provides pre-configured middleware for protecting routes that require authentication.
- Type Safety: Full TypeScript support and the ability to cast current user information to custom classes.