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.gitInstall dependencies
cd mfa-nodejs && npm iTests
npm t # recommended before to runRun in production mode
npm start # playground disabledRun in development mode
npm run devAccess the API
http://localhost:4000
Access the database
http://localhost:3000
You can contact me by: