Skip to content

Commit

Permalink
Fix totp registration (openemr#6962)
Browse files Browse the repository at this point in the history
* Update mfa_totp.php

On the original version, if you typed your password and pressed <ENTER>, a blank screen would be displayed.  This is because the <Form onsubmit=""> tag had one action, and the submit <Button> had a different onclick="" action.  This change makes it so pressing <ENTER> or clicking the Submit <Button> execute the same code...

* Update mfa_totp.php

Put type="submit" in \<button\>

* Fix TOTP Registration page

* Fix use statements order

---------

Co-authored-by: Beavis <[email protected]>
  • Loading branch information
DrBassman and Beavis authored Nov 1, 2023
1 parent a70374a commit f8c377c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/classes/Totp.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @license https://github.com/openemr/openemr/blob/master/LICENSE CNU General Public License 3
*/

use RobThree\Auth\Algorithm;
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;
use RobThree\Auth\TwoFactorAuth;

Expand Down Expand Up @@ -60,7 +61,7 @@ public function generateQrCode()
}

$qrCodeProvider = new BaconQrCodeProvider(4, '#ffffff', '#000000', 'svg');
$tfa = new TwoFactorAuth($this->_issuer, 6, 30, 'sha1', $qrCodeProvider);
$tfa = new TwoFactorAuth($this->_issuer, 6, 30, Algorithm::Sha1, $qrCodeProvider);
$qr = $tfa->getQRCodeImageAsDataUri($this->_username, $this->_secret);
if (empty($qr)) {
return false;
Expand Down

0 comments on commit f8c377c

Please sign in to comment.