diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm index 58e004c8f..c131250e2 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm @@ -540,6 +540,7 @@ sub updateSession { # Update sessionInfo data ## sessionInfo updated if $id defined : quite strange !! ## See https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng/issues/430 + $self->logger->debug("Update session $id"); foreach ( keys %$infos ) { $self->logger->debug("Update sessionInfo $_"); $self->_dump( $infos->{$_} ); diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm index 6ae0f867e..5a682fdc6 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/SecondFactor.pm @@ -78,7 +78,6 @@ sub _redirect { sub _verify { my ( $self, $req ) = @_; - my $checkLogins = $req->param('checkLogins'); $self->logger->debug("checkLogins set") if ($checkLogins); @@ -135,13 +134,15 @@ sub _verify { $req->error($error); return $self->p->do( $req, [ sub { $error } ] ); } - $self->logger->debug("Deduplicate groups..."); + $self->logger->debug("De-duplicate groups..."); $req->sessionInfo->{groups} = join $self->conf->{multiValuesSeparator}, keys %{ { map { $_ => 1 } split $self->conf->{multiValuesSeparator}, $req->sessionInfo->{groups} } }; + delete $req->sessionInfo->{_session_kind} + if ( $self->conf->{tokenUseGlobalStorage} ); $self->p->updateSession( $req, $req->sessionInfo ); } diff --git a/lemonldap-ng-portal/t/68-ContextSwitching-with-TOTP-and-Notification.t b/lemonldap-ng-portal/t/68-ContextSwitching-with-TOTP-and-Notification.t index ae3b88108..0025980f6 100644 --- a/lemonldap-ng-portal/t/68-ContextSwitching-with-TOTP-and-Notification.t +++ b/lemonldap-ng-portal/t/68-ContextSwitching-with-TOTP-and-Notification.t @@ -23,7 +23,7 @@ close F; my $client = LLNG::Manager::Test->new( { ini => { - logLevel => 'debug', + logLevel => 'error', authentication => 'Demo', userDB => 'Same', loginHistoryEnabled => 0, diff --git a/lemonldap-ng-portal/t/70-2F-TOTP-and-U2F-with-TTL-and-JSON.t b/lemonldap-ng-portal/t/70-2F-TOTP-and-U2F-with-TTL-and-JSON.t index db0a05ab1..b110f9bf5 100644 --- a/lemonldap-ng-portal/t/70-2F-TOTP-and-U2F-with-TTL-and-JSON.t +++ b/lemonldap-ng-portal/t/70-2F-TOTP-and-U2F-with-TTL-and-JSON.t @@ -259,7 +259,7 @@ JjTJecOOS+88fK8qL1TrYv5rapIdqUI7aQ== qr%%, 'Notification reference found' ) or print STDERR Dumper( $res->[2]->[0] ); - ok( time() + 120 <= $1 && $1 <= time() + 120, 'Right reference found' ) + ok( time() + 120 <= $1 && $1 <= time() + 125, 'Right reference found' ) or print STDERR Dumper( $res->[2]->[0] ); ok( $res->[2]->[0] =~ @@ -287,14 +287,14 @@ qr%

1 expired second factor\(s\) has/have been removed!

% qr%%, 'Notification reference found' ) or print STDERR Dumper( $res->[2]->[0] ); - ok( time() + 120 <= $1 && $1 <= time() + 120, 'Right reference found' ) + ok( time() + 120 <= $1 && $1 <= time() + 125, 'Right reference found' ) or print STDERR Dumper( $res->[2]->[0] ); ok( $res->[2]->[0] =~ qr%%, 'Notification reference found' ) or print STDERR Dumper( $res->[2]->[0] ); - ok( time() + 300 <= $1 && $1 <= time() + 300, 'Right reference found' ) + ok( time() + 300 <= $1 && $1 <= time() + 305, 'Right reference found' ) or print STDERR Dumper( $res->[2]->[0] ); my @notifs = ( $res->[2]->[0] =~