1.2.0 • Published 3 months ago

@luma-sys/auth-api v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Luma - Auth Module

Auth Module Module para projetos NestJS da Luma Systems.

Sumario

Instalação

npm i luma-auth-module

Modo de uso

JwtAuthGuard e @Roles

Importar os módulos de autenticação e autorização no Controller.

import { MiddlewareConsumer, Module, NestModule } from "@nestjs/common";

import { JwtAuthGuard, Roles } from "luma-auth-module";

@UseGuards(JwtAuthGuard)
@Controller("my-resource")
export class MyController {
  @Roles(Roles.SEARCH)
  @HttpCode(200)
  @Get()
  async findAll(): Promise<Object[]> {}
}

Desenvolvimento

Teste

# unit tests
npm run test

# e2e tests
npm run test:e2e

# test coverage
npm run test:cov

Referências