Bug 30588: (QA follow-up) Clear waiting-for-2FA-setup in session

If we do not clear this session, the first login directly after setup
does not really enhances user experience ;)

Test plan:
Make sure 2FA is enforced.
Test the above. Disable your 2FA, logout and login.
Verify that you can access pages with this patch now. Without this
patch you could not.
Run these tests to provide more confidence:
t/db_dependent/Auth.t
t/db_dependent/api/v1/two_factor_auth.t
t/db_dependent/Koha/Auth/TwoFactorAuth.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2022-09-12 09:02:21 +00:00 committed by Tomas Cohen Arazi
parent d92b2b4c67
commit ad6530b914
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -875,6 +875,7 @@ sub checkauth {
# The token is correct, the user is fully logged in!
$auth_state = 'completed';
$session->param( 'waiting-for-2FA', 0 );
$session->param( 'waiting-for-2FA-setup', 0 );
# This is an ugly trick to pass the test
# $query->param('koha_login_context') && ( $q_userid ne $userid )