An open API service indexing awesome lists of open source software.

https://github.com/0x4bd0/nestjs-auth-module

Basic auth authentication nestJs module, using Jwt and password hashing.
https://github.com/0x4bd0/nestjs-auth-module

auth authentication authorization jwt jwt-auth jwt-authentication jwt-token jwt-tokens nest nestjs nestjs-backend

Last synced: about 2 months ago
JSON representation

Basic auth authentication nestJs module, using Jwt and password hashing.

Awesome Lists containing this project

README

          

- NestJs Auth module with Jwt and password hashing

## Get started :
- Go to src/app.module.ts and add your mongoDB Connection URL

## Needed Packages :

```bash

$ npm install --save @nestjs/passport passport passport-local

$ npm install --save-dev @types/passport-local

$ npm install --save @nestjs/jwt passport-jwt

$ npm install --save-dev @types/passport-jwt

$ npm install --save mongoose

$ npm install --save class-validator

$ npm install --save @nestjs/mongoose

$ npm install --save @nestjs/bcrypt

$ npm install --save class-transformer

```

## Endpoints :

1- Login : '/auth/login'
- Request Body : { email, password }

2- Register : '/auth/register'
- Request Body : { email, password,username}

3- Test auth access : '/auth/jwtTest'
- Request Headers : { Authorization : Bearer + access_token }

Read more about Authentication Here