@enab/auth

1. you need `.env`:
890
Install
npm install @enab/auth
Latest Version:0.0.2-beta.29
Last Updated:May 13, 2023
Links: npm
Maintainer: hassankadhim

Usage

  1. you need .env:
API_URL="http://localhost:3000"
API_VERSION="/v1"

API_VERSION is optional.

  1. You need to extend nuxt.config.ts

add the following to nuxt.config.ts:

extends: [
  '@enab/auth',
],

enabAuth: {
    // optional roles
    roles: ['client', 'admin'],
    redirects: {
      // Defaults
      login: '/auth/login',
      logout: '/auth/login',
      home: '/',
      wrongRole: '/wrong-role'
    },
    // can be null if not dealing with subdomains or nested subdomains
    subdomains: {
      firstLevel: "restaurant", // eg => restaurant.enab.dev
      secondLevel: null, // eg => admin.restaurant.enab.dev
    },
  }

Related Packages

@enab/core

Enab WebOS Core Module

4,050
@enab/client-api

Create Nuxt extendable layer with this GitHub template.

1,071

Version History

Pre-releases (25)
Version Released License
0.0.2-beta.29
0.0.2-beta.28
0.0.2-beta.27
0.0.2-beta.26
0.0.2-beta.25