This project was created to learning and is an example to generate a 2fa method by verification code. Basically, the idea is return a qr-code and code to user add in your auth app and check generated code.
- Generate a seed key and qr-code;
- Add seed-key in account row;
- Check verification code.
To run it is necessary to have NodeJS installed in your system, prefer version 16. There's a nvm file and you can use it to install or update the node version.
Clone the repo
git clone https://github.com/willaug/mfa-nodejs.git
Install dependencies
cd mfa-nodejs && npm i
Tests
npm t # recommended before to run
Run in production mode
npm start # playground disabled
Run in development mode
npm run dev
Access the API
http://localhost:4000
Access the database
http://localhost:3000
You can contact me by: