Guest User

Untitled

a guest
Oct 19th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. const qrcode = require('qrcode-terminal');
  2.  
  3. [
  4. // {issuer: '', user: '', secret: ''}, // TODO: Fill these in.
  5. ].forEach(function(keyInfo) {
  6. const issuer = encodeURIComponent(keyInfo.issuer);
  7. const user = encodeURIComponent(keyInfo.user);
  8. const secret = keyInfo.secret.replace(/ /g, '');
  9. const url = (
  10. `otpauth://totp/${issuer}:${user}?secret=${secret}&issuer=${issuer}`);
  11. qrcode.generate(url, function(code) {
  12. console.log('\n\n\n\n\n');
  13. console.log(`${keyInfo.issuer} (${keyInfo.user}):`);
  14. console.log(code);
  15. console.log('\n\n\n\n\n');
  16. });
  17. });
Add Comment
Please, Sign In to add comment