From 53752276e421f883e801d180ad86e9ffa0f29342 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Fri, 30 Mar 2018 21:24:34 +0200 Subject: [PATCH] #1386 - Fix warnings --- .../lib/Lemonldap/NG/Portal/2F/Register/TOTP.pm | 5 +++-- .../lib/Lemonldap/NG/Portal/2F/Register/U2F.pm | 3 ++- .../lib/Lemonldap/NG/Portal/2F/Register/Yubikey.pm | 4 +++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/TOTP.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/TOTP.pm index 7249fce8a..57ea376a8 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/TOTP.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/TOTP.pm @@ -1,4 +1,4 @@ -# Self U2F registration +# Self TOTP registration package Lemonldap::NG::Portal::2F::Register::TOTP; use strict; @@ -94,13 +94,14 @@ sub run { { _totp2fSecret => $token->{_totp2fSecret} } ); my $list2FDevices = eval { + $self->logger->debug("Looking for 2F Devices ..."); from_json( $req->userData->{list2FDevices}, { allow_nonref => 1 } ); }; unless ($list2FDevices) { $self->logger->debug("No 2F Device found"); $list2FDevices = []; } - push $list2FDevices, + push @{$list2FDevices}, { type => 'totp', name => $TOTPName, diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/U2F.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/U2F.pm index 45aa49b7f..650ec7f89 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/U2F.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/U2F.pm @@ -65,6 +65,7 @@ sub run { if ( $keyHandle and $userKey ) { my $list2FDevices = eval { + $self->logger->debug("Looking for 2F Devices ..."); from_json( $req->userData->{list2FDevices}, { allow_nonref => 1 } ); }; @@ -73,7 +74,7 @@ sub run { $list2FDevices = []; } my $keyName = $req->param('keyName'); - push $list2FDevices, + push @{$list2FDevices}, { type => 'U2F', name => $keyName, diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/Yubikey.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/Yubikey.pm index c4f1a96a2..44845e264 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/Yubikey.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Register/Yubikey.pm @@ -1,3 +1,4 @@ +# Self Yubikey registration package Lemonldap::NG::Portal::2F::Register::Yubikey; use strict; @@ -44,6 +45,7 @@ sub run { my $key = substr( $otp, 0, $self->conf->{yubikey2fPublicIDSize} ); my $list2FDevices = eval { + $self->logger->debug("Looking for 2F Devices ..."); from_json( $req->userData->{list2FDevices}, { allow_nonref => 1 } ); }; @@ -51,7 +53,7 @@ sub run { $self->logger->debug("No 2F Device found"); $list2FDevices = []; } - push $list2FDevices, + push @{$list2FDevices}, { type => 'UBK', name => $UBKName,