mirror of
https://git.proxmox.com/git/pve-access-control
synced 2025-10-04 21:05:57 +00:00
tfa: fix http 404 in get_tfa_entry
this produced warnings in the journal and returned code 500 instead Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
1c9b650186
commit
b3dae5dd48
@ -3,6 +3,8 @@ package PVE::API2::TFA;
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
|
use HTTP::Status qw(:constants);
|
||||||
|
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
use PVE::Cluster qw(cfs_read_file cfs_write_file);
|
use PVE::Cluster qw(cfs_read_file cfs_write_file);
|
||||||
use PVE::JSONSchema qw(get_standard_option);
|
use PVE::JSONSchema qw(get_standard_option);
|
||||||
@ -280,7 +282,7 @@ __PACKAGE__->register_method ({
|
|||||||
my $tfa_cfg = cfs_read_file('priv/tfa.cfg');
|
my $tfa_cfg = cfs_read_file('priv/tfa.cfg');
|
||||||
my $id = $param->{id};
|
my $id = $param->{id};
|
||||||
my $entry = $tfa_cfg->api_get_tfa_entry($param->{userid}, $id);
|
my $entry = $tfa_cfg->api_get_tfa_entry($param->{userid}, $id);
|
||||||
raise("No such tfa entry '$id'", 404) if !$entry;
|
raise("No such tfa entry '$id'", code => HTTP::Status::HTTP_NOT_FOUND) if !$entry;
|
||||||
return $entry;
|
return $entry;
|
||||||
}});
|
}});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user