1.0.6 • Published 2 years ago

@tecnual/nestjs-auth v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NestJS Authentication

Implement authentication in your NestJS application.

Install

npm install @tecnual/nestjs-auth --save

OR

yarn add @tecnual/nestjs-auth

How To Use?

The package exports mainly a dynamic module. The module should be imported in your app.module.ts.

Example Code your app module

Simple static configuration

If you just want to provide the static values or have them handy, pass them as options to the register method like below. The options object is type of NestjsAuthOptions.

import { Module } from '@nestjs/common';
import { NestjsAuthModule } from '@tecnual/nestjs-auth';
import { AppController } from './app.controller';
import { AppService } from './app.service';


@Module({
  imports: [NestjsAuthModule.register({config: {
    JWTSecret: process.env.JWT_SECRET || 'supersecret',
    JWTExpiresIn: process.env.JWT_EXPIRATION || '1d',
    database: {
      url: 'mongodb+srv://[DATABASE_USERNAME]:[PASSWORD]@cluster0.gu0r4.mongodb.net/[DATABASE_NAME]?retryWrites=true&w=majority'
    },
    environment: process.env.NODE_ENV || 'production',
    verbose: true
    }
  })],
  controllers:  [AppController],
  providers:    [AppService]
})

/**
 * Main App Module
 */
 export class AppModule {}

Maintainers

Libertual

1.0.2

2 years ago

1.0.0

2 years ago

1.0.6

2 years ago

0.0.22

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago