Skip to content

CptDarling/2fa_example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

2FA Example

Install

npm install

Run

npm run dev

Usage

You can now use tools like Postman to generate secrets and verify tokens using the endpoints:

  • POST /generate-secret with body { "username": "user1" }
  • POST /verify with body { "username": "user1", "token": "123456"}

This is a simple starting point. In a real-world application, you'll need to store user data securely, possibly in a database, and implement additional error handling and security measures.

Database

This project is using MongoDB.

About

An example of implementing 2FA in a NodeJS app

Topics

Resources

Stars

Watchers

Forks