Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const qrcode = require('qrcode-terminal');
- [
- // {issuer: '', user: '', secret: ''}, // TODO: Fill these in.
- ].forEach(function(keyInfo) {
- const issuer = encodeURIComponent(keyInfo.issuer);
- const user = encodeURIComponent(keyInfo.user);
- const secret = keyInfo.secret.replace(/ /g, '');
- const url = (
- `otpauth://totp/${issuer}:${user}?secret=${secret}&issuer=${issuer}`);
- qrcode.generate(url, function(code) {
- console.log('\n\n\n\n\n');
- console.log(`${keyInfo.issuer} (${keyInfo.user}):`);
- console.log(code);
- console.log('\n\n\n\n\n');
- });
- });
Add Comment
Please, Sign In to add comment