// Use the node-qrcode package
// npm install --save node-qrcode
var QRCode = require('qrcode');
// Get the data URL of the authenticator URL
QRCode.toDataURL(secret.otpauth_url, function(err, data_url) {
console.log(data_url);
// Display this data URL to the user in an <img> tag
// Example:
write('<img src="' + data_url + '">');
});
The node-qrcode package is now installed with npm install --save qrcode, node-qrcode points to a different package now.
The node-qrcode package is now installed with
npm install --save qrcode
,node-qrcode
points to a different package now.https://github.com/soldair/node-qrcode