mirror of
git://git.proxmox.com/git/pve-apiclient.git
synced 2025-02-28 13:57:33 +03:00
login TFA exception: also print username and use raise
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com> (cherry picked from commit 8bc98506cbcb3ee30f026cb91b5d584291ca9152) Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
47be18e56a
commit
9998518d7d
@ -102,12 +102,13 @@ sub login {
|
||||
$uri->path('/api2/json/access/ticket');
|
||||
|
||||
my $ua = $self->{useragent};
|
||||
my $username = $self->{username} // 'unknown',
|
||||
|
||||
delete $self->{last_unknown_fingerprint};
|
||||
|
||||
my $exec_login = sub {
|
||||
return $ua->post($uri, {
|
||||
username => $self->{username} || 'unknown',
|
||||
username => $username,
|
||||
password => $self->{password} || ''});
|
||||
};
|
||||
|
||||
@ -131,7 +132,7 @@ sub login {
|
||||
|
||||
# TODO: make it possible to use 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});
|
||||
|
Loading…
x
Reference in New Issue
Block a user