mirror of
git://git.proxmox.com/git/pve-apiclient.git
synced 2025-03-12 04:58:26 +03:00
login TFA exception: also print username and use raise
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
985f120305
commit
8bc98506cb
@ -102,12 +102,13 @@ sub login {
|
|||||||
$uri->path('/api2/json/access/ticket');
|
$uri->path('/api2/json/access/ticket');
|
||||||
|
|
||||||
my $ua = $self->{useragent};
|
my $ua = $self->{useragent};
|
||||||
|
my $username = $self->{username} // 'unknown',
|
||||||
|
|
||||||
delete $self->{last_unknown_fingerprint};
|
delete $self->{last_unknown_fingerprint};
|
||||||
|
|
||||||
my $exec_login = sub {
|
my $exec_login = sub {
|
||||||
return $ua->post($uri, {
|
return $ua->post($uri, {
|
||||||
username => $self->{username} || 'unknown',
|
username => $username,
|
||||||
password => $self->{password} || ''});
|
password => $self->{password} || ''});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -131,7 +132,7 @@ sub login {
|
|||||||
|
|
||||||
# TODO: make it possible to use tfa
|
# TODO: make it possible to use tfa
|
||||||
if ($data->{ticket} =~ m/^PVE:tfa!/) {
|
if ($data->{ticket} =~ m/^PVE:tfa!/) {
|
||||||
die "TFA in API is not yet implemented! Try disabling TFA for the user.\n";
|
raise("Two Factor Auth is not yet implemented! Try disabling TFA for the user '$username'.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->update_ticket($data->{ticket});
|
$self->update_ticket($data->{ticket});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user