Bugzilla – Attachment 143264 Details for
Bug 32066
2FA: User could get stuck temporarily on login screen when disabling pref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32066: Add unit test to Auth.t
Bug-32066-Add-unit-test-to-Autht.patch (text/plain), 1.88 KB, created by
Kyle M Hall (khall)
on 2022-11-04 18:02:49 UTC
(
hide
)
Description:
Bug 32066: Add unit test to Auth.t
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2022-11-04 18:02:49 UTC
Size:
1.88 KB
patch
obsolete
>From 4b74d57f45a23fe5aaa61aafb731dcca459071de Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 3 Nov 2022 08:49:26 +0000 >Subject: [PATCH] Bug 32066: Add unit test to Auth.t > >Test plan: >Run without next patch. Should fail. >Run with next patch. Should pass. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Auth.t | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > >diff --git a/t/db_dependent/Auth.t b/t/db_dependent/Auth.t >index 83e15bdf05..c8da8bd89d 100755 >--- a/t/db_dependent/Auth.t >+++ b/t/db_dependent/Auth.t >@@ -153,6 +153,7 @@ subtest 'checkauth() tests' => sub { > }; > > subtest 'Two-factor authentication' => sub { >+ plan tests => 18; > > my $patron = $builder->build_object( > { class => 'Koha::Patrons', value => { flags => 1 } } ); >@@ -245,7 +246,18 @@ subtest 'checkauth() tests' => sub { > 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' ); > >+ # > t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 'disabled' ); >+ $session = C4::Auth::get_session($sessionID); >+ $session->param('waiting-for-2FA', 1); >+ $session->flush; >+ my ($auth_status, undef ) = C4::Auth::check_cookie_auth($sessionID, undef ); >+ is( $auth_status, 'ok', 'User authenticated, pref was disabled, access OK' ); >+ $session->param('waiting-for-2FA', 0); >+ $session->param('waiting-for-2FA-setup', 1); >+ $session->flush; >+ ($auth_status, undef ) = C4::Auth::check_cookie_auth($sessionID, undef ); >+ is( $auth_status, 'ok', 'User waiting for 2FA setup, pref was disabled, access OK' ); > }; > > C4::Context->_new_userenv; # For next tests >-- >2.30.2
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 32066
:
143066
|
143067
|
143071
|
143072
|
143263
| 143264 |
143265