title: Generating a test QRCode that can be reused
body: <p>I'm using this library for 2 factor auth: <a href="https://github.com/speakeasyjs/speakeasy" rel="nofollow noreferrer">https://github.com/speakeasyjs/speakeasy</a></p>
  
  <p>I'm using this QR Code library: <a href="https://www.npmjs.com/package/qrcode" rel="nofollow noreferrer">https://www.npmjs.com/package/qrcode</a></p>
  
  <p>In dev mode, I seed the database with a test user.  But I'm on a team and now that 2FA is implemented, people need to pass in a 2FA token to login with this user.  Is there a way I could generate a QR Code for this test user that can be reused by everyone on the team?  That way, they just scan it into their phone and use the token.</p>
  
  <p>I tried the naive way: I generated a QR Code, saved it as an image, and put it in the README.  It works fine for me, but when anyone else tries to scan it, it says "Invalid Barcode" in google auth.  Something that's confusing is I can delete it from google auth and scan it again without issue, even though nobody else can.  I assume this means the QR Code is only usable by one device?</p>
  
  <p>I <em>could</em> just say you don't have to use 2FA if you're in dev mode, but I really don't like that route: It's a security bug waiting to happen.  Someone could start prod in dev mode on accident.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>  generateQRFromSecret({
      secret: 'secret',
      label: 'label',
      issuer: 'issuer',
    });
  </code></pre>
  
  <hr>
  
  <pre><code>const generateQRFromSecret = ({ secret, label, issuer }) =&gt;
    new Promise((resolve, reject) =&gt; {
      const otpAuthUrl = speakeasy.otpauthURL({
        secret,
        label,
        issuer,
        encoding: 'base32',
      });
      QRCode.toDataURL(otpAuthUrl, (err, dataUrl) =&gt; {
        if (err) {
          reject(err);
        } else {
          resolve(dataUrl);
        }
      });
    });
  </code></pre>
  
  <p>UPDATE:  Android phones seem to be able to read the QR Code fine.  It's iphones that can't.</p>