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:
parent
3a359ba3f7
commit
e558c90e3f
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue