More Premium Hugo Themes Premium Nuxt Themes

Auth

An alternative module to @nuxtjs/auth

Auth

An alternative module to @nuxtjs/auth

Author Avatar Theme by nuxt-alt
Github Stars Github Stars: 115
Last Commit Last Commit: Jun 24, 2024 -
First Commit Created: Aug 27, 2024 -
default image

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:

  1. Add @nuxt-alt/auth and @nuxt-alt/http dependencies to your project.
  2. 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',
      ],
    }
    
  3. 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.