Bugzilla – Attachment 142697 Details for
Bug 32011
2FA - Problem with qr_code generation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32011: 2FA - Prevent qr_code to not be generated
Bug-32011-2FA---Prevent-qrcode-to-not-be-generated.patch (text/plain), 1.92 KB, created by
Jonathan Druart
on 2022-10-27 09:03:15 UTC
(
hide
)
Description:
Bug 32011: 2FA - Prevent qr_code to not be generated
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-10-27 09:03:15 UTC
Size:
1.92 KB
patch
obsolete
>From 44be4b35c8b67e1aeb2cdb216cb333c5332fa27d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 27 Oct 2022 10:53:06 +0200 >Subject: [PATCH] Bug 32011: 2FA - Prevent qr_code to not be generated > >Caught by selenium/authentication_2fa.t > > # Failed test 'Enforce 2FA setup on first login' > # at t/db_dependent/selenium/authentication_2fa.t line 291.Error while executing command: unexpected alert open: Dismissed user prompt dialog: [object Object] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411. > at /usr/share/perl5/Selenium/Remote/Driver.pm line 356. > >There is a 500 in the logs: > "POST /api/v1/app.pl/api/v1/auth/two-factor/registration HTTP/1.1" 500 > >That is caused by >[ERROR] POST /api/v1/auth/two-factor/registration: unhandled exception (Mojo::Exception)<<Overflow error. version 8 >total bits: 1268 max bits: 1232>> > >It's coming from GD::Barcode, in my understanding we should increase 'Version'. > >Test plan: >Remove all other subtests from the selenium to speed up its exec, then >run it in a loop. Without this patch the tests fail quite often (1/10), >now it should not fail with this error (maybe another one, see bug >32010) >--- > Koha/Auth/TwoFactorAuth.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Koha/Auth/TwoFactorAuth.pm b/Koha/Auth/TwoFactorAuth.pm >index b9c785fa0e7..5cd6d13ac7d 100644 >--- a/Koha/Auth/TwoFactorAuth.pm >+++ b/Koha/Auth/TwoFactorAuth.pm >@@ -101,7 +101,7 @@ sub qr_code { > > my $otpauth = $self->SUPER::qr_code( undef, undef, undef, 1); > # no need to pass secret, key and issuer again >- my $qrcode = GD::Barcode->new( 'QRcode', $otpauth, { Ecc => 'M', Version => 8, ModuleSize => 4 } ); >+ my $qrcode = GD::Barcode->new( 'QRcode', $otpauth, { Ecc => 'M', Version => 10, ModuleSize => 4 } ); > my $data = $qrcode->plot->png; > return "data:image/png;base64,". encode_base64( $data, q{} ); # does not contain newlines > } >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 32011
:
142696
| 142697