Nestjs Authentication And Authorization

screenshot of Nestjs Authentication And Authorization
nestjs

NestJS Authentication without Passport using Bcrypt, JWT and Redis

Overview

This article provides an overview of NestJS AuthenticationWorkflow, a project that demonstrates how to implement authentication in NestJS without using Passport. It utilizes Bcrypt for password hashing, JWT for token-based authentication, and Redis for session management. The project includes features such as user registration, login, profile display, and logout. The technologies used in the stack include Bcrypt, JWT, TypeORM (with MySQL), Redis, and Docker. The article also provides instructions on how to set up the project and references for further reading.

Features

  • Register: Allows users to create an account.
  • Login: Provides the ability for users to log in to their accounts.
  • Show profile: Displays the user's profile information.
  • Logout: Allows users to securely log out of their accounts.

Summary

The NestJS AuthenticationWorkflow project provides an alternative approach to implementing authentication in NestJS without relying on Passport. By using tools such as Bcrypt for password hashing, JWT for token-based authentication, and Redis for session management, this project offers a secure and robust authentication workflow. The provided features of user registration, login, profile display, and logout make it a comprehensive and practical solution for handling authentication in NestJS applications. Additionally, the use of technologies like TypeORM (with MySQL) and Docker further enhances the project's versatility and ease of setup.

nestjs
Nest

A progressive Node.js framework for building efficient, scalable, and enterprise-grade server-side applications with TypeScript/JavaScript.

docker
Docker

A website that uses Docker for containerization to streamline development, testing, and deployment workflows. This includes features such as containerization of dependencies, automated builds and deployments, and container orchestration to ensure scalability and availability.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.