Bugzilla – Attachment 141990 Details for
Bug 30588
Add the option to require 2FA setup on first staff login
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30588: (QA follow-up) Auth - remove two warns and second logout
Bug-30588-QA-follow-up-Auth---remove-two-warns-and.patch (text/plain), 2.12 KB, created by
Jonathan Druart
on 2022-10-17 15:06:22 UTC
(
hide
)
Description:
Bug 30588: (QA follow-up) Auth - remove two warns and second logout
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-10-17 15:06:22 UTC
Size:
2.12 KB
patch
obsolete
>From aa51162ffb7cdc24e8c250acb9870f7155570427 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Fri, 9 Sep 2022 09:18:10 +0000 >Subject: [PATCH] Bug 30588: (QA follow-up) Auth - remove two warns and second > logout > >Resolves: >Use of uninitialized value $request_method in string eq at /usr/share/koha/C4/Auth.pm line 1122. >Use of uninitialized value $return in numeric gt (>) at /usr/share/koha/C4/Auth.pm line 1155. > >We also remove the double logout from Auth.t > >Test plan: >Run t/db_dependent/Auth.t >Check if you do not see the warns anymore. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 4 ++-- > t/db_dependent/Auth.t | 1 - > 2 files changed, 2 insertions(+), 3 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index fed9c5fd5db..843079f13f8 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -1073,7 +1073,7 @@ sub checkauth { > } > else { > my $retuserid; >- my $request_method = $query->request_method(); >+ my $request_method = $query->request_method // q{}; > > if ( > $request_method eq 'POST' >@@ -1108,7 +1108,7 @@ sub checkauth { > } > > # $return: 1 = valid user >- if ($return > 0) { >+ if( $return && $return > 0 ) { > > if ( $flags = haspermission( $userid, $flagsrequired ) ) { > $auth_state = "logged_in"; >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 2ed7bc5db50..83e15bdf055 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -241,7 +241,6 @@ subtest 'checkauth() tests' => sub { > is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA-setup'), 1, 'Setup 2FA required' ); > logout($cgi); > >- logout($cgi); > ( $userid, $cookie, $sessionID, $flags ) = C4::Auth::checkauth( $cgi, 'authrequired', undef, 'opac' ); > is( $userid, $patron->userid, 'Succesful login at the OPAC' ); > is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), undef, 'No second auth required at the OPAC' ); >-- >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 30588
:
138160
|
138161
|
138162
|
138163
|
138164
|
138165
|
138166
|
138191
|
138193
|
138953
|
138954
|
138955
|
138956
|
138957
|
138958
|
138959
|
138960
|
138961
|
138962
|
140365
|
140366
|
140367
|
140368
|
140369
|
140416
|
140417
|
140418
|
140419
|
140420
|
140421
|
140422
|
140423
|
140424
|
140425
|
140426
|
140427
|
140428
|
140429
|
140430
|
141978
|
141979
|
141980
|
141981
|
141982
|
141983
|
141984
|
141985
|
141986
|
141987
|
141988
|
141989
|
141990
|
141991
|
141992
|
142344
|
142345
|
142346
|
142347
|
142348
|
142349
|
142350
|
142351
|
142352
|
142353
|
142354
|
142355
|
142356
|
142357
|
142358