2FA TOTP implementation using Node.js, TypeScript, and React.js
- Node JS
- Typescript
- React JS
- Vite
The backend includes the APIs for generating QR code and verifying TOTP code.
The client includes a UI for showing QR codes and an input form to take a TOTP code.
## Clone the Application
git clone https://github.com/santoshshinde2012/multi-factor-authentication.git
## Install the dependencies
cd multi-factor-authentication && npm install
## Make sure to up your database
npm run db:up
## Start the application
npm run dev
├── multi-factor-authentication
│ ├── backend
│ │ ├── ....
│ │ ├── package-lock.json
│ │ └── package.json
│ ├── client
│ │ ├── ....
│ │ ├── package-lock.json
│ │ └── package.json
│ ├── wiki
│ │ ├── ....
│ │ └──
│ ├── README.md
│ ├── package-lock.json
│ └── package.json
api/v1/mfa/ready
: Check setup is ready or notapi/v1/mfa/generate
: Generate the OTP Secretapi/v1/mfa/verify
: Verify the OTP Secretapi/v1/mfa/validate
: Validate the OTP codeapi/v1/mfa/reset
: Reset using the backup code