From 4dbffa8b314224a296099679a3a9f8bf37ca005f Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Fri, 5 Sep 2025 16:51:38 +0100 Subject: [PATCH] Bug 30724: (follow-up) Corrections for self-enabling 2FA Signed-off-by: David Nind --- .../intranet-tmpl/prog/en/modules/members/two_factor_auth.tt | 3 ++- members/two_factor_auth.pl | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt index a93144a46b..942740d3ff 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt @@ -68,6 +68,7 @@
[% INCLUDE 'csrf-token.inc' %] +
@@ -145,7 +146,7 @@ type: "POST", url: "/api/v1/auth/two-factor/registration/verification", success: function (data) { - window.location = "/cgi-bin/koha/members/two_factor_auth.pl"; + window.location = "/cgi-bin/koha/members/two_factor_auth.pl?borrowernumber=[% patron.borrowernumber | url %]"; }, error: function (data) { const error = data.responseJSON.error; diff --git a/members/two_factor_auth.pl b/members/two_factor_auth.pl index 3c980e10f8..c0ba3d2832 100755 --- a/members/two_factor_auth.pl +++ b/members/two_factor_auth.pl @@ -49,7 +49,7 @@ my $another_user = $patron_id ne $loggedinuser; my $logged_in_user = Koha::Patrons->find($loggedinuser); -unless ( !$another_user || $logged_in_user->is_superlibrarian() ) { +if ( $another_user && !$logged_in_user->is_superlibrarian() ) { print $cgi->redirect("/cgi-bin/koha/errors/403.pl"); exit; } -- 2.39.5