]> BookStack Code Mirror - bookstack/commitdiff
Added attribution for new libs added
authorDan Brown <redacted>
Sun, 8 Aug 2021 13:52:29 +0000 (14:52 +0100)
committerDan Brown <redacted>
Sun, 8 Aug 2021 13:52:29 +0000 (14:52 +0100)
- Also hard-set TOTP algorithm with comment from testing others.

app/Auth/Access/Mfa/TotpService.php
readme.md
resources/views/users/edit.blade.php

index f9a9f416ee30e27c42ac0b0116a959d8c30005ae..d1013978bb6b813757f16fa8f761be21dcf53a2a 100644 (file)
@@ -9,6 +9,7 @@ use BaconQrCode\Renderer\RendererStyle\Fill;
 use BaconQrCode\Renderer\RendererStyle\RendererStyle;
 use BaconQrCode\Writer;
 use PragmaRX\Google2FA\Google2FA;
+use PragmaRX\Google2FA\Support\Constants;
 
 class TotpService
 {
@@ -17,6 +18,10 @@ class TotpService
     public function __construct(Google2FA $google2fa)
     {
         $this->google2fa = $google2fa;
+        // Use SHA1 as a default, Personal testing of other options in 2021 found
+        // many apps lack support for other algorithms yet still will scan
+        // the code causing a confusing UX.
+        $this->google2fa->setAlgorithm(Constants::SHA1);
     }
 
     /**
index 1b8c6606192bf3b21ec0898ee6e3fdbbc930c56b..c0bef7c7a51898f7b83a539b498e02b9b84837a6 100644 (file)
--- a/readme.md
+++ b/readme.md
@@ -189,4 +189,6 @@ These are the great open-source projects used to help build BookStack:
 * [OneLogin's SAML PHP Toolkit](https://github.com/onelogin/php-saml)
 * [League/CommonMark](https://commonmark.thephpleague.com/)
 * [League/Flysystem](https://flysystem.thephpleague.com)
-* [StyleCI](https://styleci.io/)
\ No newline at end of file
+* [StyleCI](https://styleci.io/)
+* [pragmarx/google2fa](https://github.com/antonioribeiro/google2fa)
+* [Bacon/BaconQrCode](https://github.com/Bacon/BaconQrCode)
\ No newline at end of file
index 4c733e6f684f907338036492b717e2e8394297ba..d882558a4687f7b4d2ac9f7d14c32b649816cfe4 100644 (file)
@@ -74,7 +74,6 @@
                         <span class="text-neg">@icon('cancel')</span>
                     @endif
                     {{ trans_choice('settings.users_mfa_x_methods', $mfaMethods->count()) }}
-                    {{ $mfaMethods->count() }} {{ $mfaMethods->count() === 1 ? 'method' : 'methods' }} configured
                 </div>
                 <div class="text-m-right">
                     @if($user->id === user()->id)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.