title: pgAdmin docker 2FA TOTP authentication error "Failed to validate the code"
body: <p>I'm using the <code>dpage/pgadmin4:6.3</code> image available at <a href="https://hub.docker.com/r/dpage/pgadmin4/" rel="nofollow noreferrer">https://hub.docker.com/r/dpage/pgadmin4/</a></p>
  <p>I'm trying to setup the 2FA TOTP based authentication by clicking on the top-right corner of the app (user icon) then on &quot;Two-Factor Authentication&quot; to open a new popup with the QR code displayed in my web browser (Firefox 95.0.2 at the time of writing).</p>
  <p>I scan the code (either with the DUO or the FREOTP+ applications (both are giving me the same code at the same time)) then I enter it in the app and click &quot;Continue&quot; but this message shows:</p>
  <blockquote>
  <p>Failed to validate the code</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/XrbJg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/XrbJg.png" alt="enter image description here" /></a></p>
  <p>Service log (docker) prints this line when clicking on the &quot;Continue&quot; button:</p>
  <pre><code>pgadmin4 | ::ffff:172.18.0.1 - - [12/Jan/2022:08:38:07 +0000] &quot;POST /mfa/register HTTP/1.1&quot; 200 19240 &quot;http://localhost:5050/mfa/register&quot; &quot;Mozilla/5.0 (X11; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0&quot;
  </code></pre>
  <p>How could I get it to work?</p>
  <p>Please note that both scanning applications on the mobile device are perfectly working for other websites needing 2FA authentication such as github or others.</p>
  <p><strong>Edit</strong>:<br />
  The same error occurs with:<br />
  <code>dpage/pgadmin4:6.4</code><br />
  <code>dpage/pgadmin4:6.5</code></p>