Open Jamesabira opened 1 year ago
To Test
npm install
node index.js
Open your web browser and navigate to http://localhost:3000
.
On the registration form, enter a new username and password.
Check the "Enable Two-Factor Authentication" checkbox.
Click the "Generate 2FA QR Code" button.
Scan the QR code with your smartphone to install a 2FA authentication app.
Open the 2FA authentication app and generate a one-time password (OTP).
Enter the OTP into the "Enter 2FA Code" field on the registration form.
Click the "Register" button.
If the registration is successful, you should receive a confirmation message.
You can also test the 2FA functionality by logging in to your account and enabling 2FA in your account settings. Once 2FA is enabled, you will need to enter a one-time password from your 2FA authentication app to log in.
qrcode.min.js
andspeakeasy.min.js
scripts to use local files, DemonstrationHTML (index.html)
JavaScript (script.js)
CSS (styles.css)
qrcode.min.js
andspeakeasy.min.js
scripts, When you integrate these scripts into your project, make sure to have these files in your project folder. This code provides a complete HTML form with JavaScript functionality for 2FA setup during registration. Users can enable 2FA, generate a QR code, and enter their 2FA code for registration.