From: Wolfgang Bumiller Date: Tue, 2 Apr 2019 10:22:00 +0000 (+0200) Subject: add u2f challenge accessors to RESTEnvironment X-Git-Url: https://git.proxmox.com/?p=pve-common.git;a=commitdiff_plain;h=61aca93afb586c57d0135036b763b3aa67968084 add u2f challenge accessors to RESTEnvironment Signed-off-by: Wolfgang Bumiller --- diff --git a/src/PVE/RESTEnvironment.pm b/src/PVE/RESTEnvironment.pm index aca18bc..b32c452 100644 --- a/src/PVE/RESTEnvironment.pm +++ b/src/PVE/RESTEnvironment.pm @@ -217,6 +217,20 @@ sub get_user { die "user name not set\n"; } +sub set_u2f_challenge { + my ($self, $challenge) = @_; + + $self->{u2f_challenge} = $challenge; +} + +sub get_u2f_challenge { + my ($self, $noerr) = @_; + + return $self->{u2f_challenge} if defined($self->{u2f_challenge}) || $noerr; + + die "no active u2f challenge\n"; +} + sub is_worker { my ($class) = @_;