/nestjs-auth-demo

Repository for notes and putting into practice what was taught in the course

Primary LanguageTypeScript

NestJS Authentication: JWTs, Sessions, logins, and more! | NestJS PassportJS Tutorial

Sumary

Description

Topics

  • UsersService
  • AuthService
  • Implementing passport-local strategy (username/password login)
  • AuthGuards
  • Summary of local login flow
  • Guard to check if user is authenticated
  • Setting up sessions
  • Summary of login with sessions flow
  • Setting up JWT strategy, signing and validating
  • Summary of JWT strategy flow

Dependecies

  • Nest - framework TypeScript
  • Node.js - is an open-source, cross-platform JavaScript runtime environment
  • passport-npm - Passport strategy for authenticating an npm client.

Installation

$ npm install

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov