Bug 30724: (follow-up) Corrections for self-enabling 2FA

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2025-09-05 16:51:38 +01:00 committed by Lucas Gass
parent 3a359ba3f7
commit e558c90e3f
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
2 changed files with 3 additions and 2 deletions

View File

@ -68,6 +68,7 @@
<form id="two-factor-auth" action="/cgi-bin/koha/members/two_factor_auth.pl" method="post">
[% INCLUDE 'csrf-token.inc' %]
<input type="hidden" name="op" value="cud-disable-2FA" />
<input type="hidden" name="borrowernumber" value="[% patron.id | html %]" />
<input type="submit" value="Disable two-factor authentication" />
</form>
</div>
@ -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;

View File

@ -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;
}