@@ -, +, @@ ajax call --- koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 6 ++++-- t/db_dependent/selenium/authentication_2fa.t | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt @@ -252,8 +252,7 @@ type: 'POST', url: '/api/v1/auth/two-factor/registration/verification', success: function (data) { - alert(_("Two-factor authentication correctly configured. You will be redirected to the login screen.")); - window.location = "/cgi-bin/koha/mainpage.pl"; + return; }, error: function (data) { const error = data.responseJSON.error; @@ -263,6 +262,9 @@ alert(error); } }, + }).then(function(){ + alert(_("Two-factor authentication correctly configured. You will be redirected to the login screen.")); + window.location = "/cgi-bin/koha/mainpage.pl"; }); }); --- a/t/db_dependent/selenium/authentication_2fa.t +++ a/t/db_dependent/selenium/authentication_2fa.t @@ -279,6 +279,7 @@ SKIP: { $driver->find_element('//*[@id="pin_code"]')->clear; $driver->find_element('//*[@id="pin_code"]')->send_keys($pin_code); $driver->find_element('//*[@id="register-2FA"]')->click; + $s->wait_for_ajax; is( $driver->get_alert_text, "Two-factor authentication correctly configured. You will be redirected to the login screen." ); --