Bug 31247: Add tests

Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit e9891b84fe)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2022-07-27 17:52:34 +02:00 committed by Lucas Gass
parent 33fb60358f
commit 8da1b675ff

View file

@ -193,6 +193,11 @@ subtest 'checkauth() tests' => sub {
is( $userid, $patron->userid, 'Succesful login' );
is( C4::Auth::get_session($sessionID)->param('waiting-for-2FA'), 0, 'Second auth no longer required if OTP token has been verified' );
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' );
t::lib::Mocks::mock_preference( 'TwoFactorAuthentication', 0 );
};