add u2f challenge accessors to RESTEnvironment
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Tue, 2 Apr 2019 10:22:00 +0000 (12:22 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 3 Apr 2019 10:16:16 +0000 (12:16 +0200)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/PVE/RESTEnvironment.pm

index aca18bc..b32c452 100644 (file)
@@ -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) = @_;