Overview
This module serves as an alternative to @nuxtjs/auth, specifically for use with Nuxt3 without backward compatibility support. By integrating @nuxt-alt/auth and @nuxt-alt/http dependencies into your project, you can enhance authentication functionalities. It provides a convenient useAuth() composable for accessing authentication methods.
Features
- Composable Access: Utilize the useAuth() composable to easily access authentication methods.
- Global Middleware Control: Enable or disable middleware for global usage.
- Storage Options: Choose between Pinia, localStorage, sessionStorage, or cookie storage options.
Installation
To install the theme, follow these steps:
- Add @nuxt-alt/auth and @nuxt-alt/http dependencies to your project.
- Include @nuxt-alt/auth and @pinia/nuxt in the modules section of nuxt.config.ts.
// nuxt.config.ts export default { modules: [ '@nuxt-alt/auth', '@pinia/nuxt', ], }
- Optionally, add @nuxt-alt/http below the auth module if manual addition is desired.
Summary
The Nuxt3 authentication module, @nuxt-alt/auth, provides a streamlined solution for authentication within Nuxt3 projects. By integrating this module, users can benefit from features such as composable access, global middleware control, and versatile storage options. With easy installation steps and enhanced functionalities compared to @nuxtjs/auth, @nuxt-alt/auth offers a flexible and efficient authentication solution for Nuxt3 projects.