🚀 Implementing 2FA Authentication with │ │ NestJS, Docker, and TypeORM │ │ 🔒 Enhance Security: Login Using Any │ │ Authenticator App
$ npm install
Create .env file
DB_TYPE=
POSTGRES_HOST=
POSTGRES_PORT=
DATABASE_USER=
DATABASE_PASSWORD=
DB_NAME=
POSTGRES_USER=
DB_USERNAME=
DB_PASSWORD=
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
PGADMIN_LISTEN_PORT=
APP_PORT=3000
JWT_ACCESS_TOKEN_SECRET=
JWT_ACCESS_TOKEN_EXPIRATION_TIME=
JWT_REFRESH_TOKEN_SECRET=anyRefreshKey
JWT_REFRESH_TOKEN_EXPIRATION_TIME=28800
TWO_FACTOR_AUTHENTICATION_APP_NAME=exchange-app
DOCKER_BUILD_IMAGE_NAME=2fa-exchange
DOCKER_REPOSITORY=
$ chmod +x script.sh
$ ./script.sh
http://localhost:3000/docs
/2fa/generate-qr
: endpoint likely represents an API endpoint in a web application responsible for generating a QR code to enable two-factor authentication (2FA) for a user./2fa/activate
: endpoint is a route in a web application that facilitates the activation process for two-factor authentication (2FA). This endpoint typically handles HTTP POST requests and expects the user to provide necessary information, such as an authentication code, to enable 2FA for their account./2fa/authenticate
: endpoint is typically used in the context of two-factor authentication (2FA) within a web application. This endpoint is designed to handle the authentication process when a user attempts to verify their identity using two factors: something they know (e.g., a password) and something they have (e.g., a mobile device).
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Join in to contribute and enhance the Exchange API experience!.
- Author - Suman Manna
- Website - https://iamsuman.com/