Add SAMESITE template param (#2605)

This commit is contained in:
Maxime Besson 2021-09-23 17:36:36 +02:00
parent a4e15ad9a9
commit 6302c957cc

View File

@ -9,7 +9,7 @@
# #
package Lemonldap::NG::Portal::Main::Run; package Lemonldap::NG::Portal::Main::Run;
our $VERSION = '2.0.14'; our $VERSION = '2.0.13';
package Lemonldap::NG::Portal::Main; package Lemonldap::NG::Portal::Main;
@ -17,10 +17,7 @@ use strict;
use URI::Escape; use URI::Escape;
use URI; use URI;
use JSON; use JSON;
use Lemonldap::NG::Common::Util qw( use Lemonldap::NG::Common::Util qw(getPSessionID getSameSite);
getPSessionID
getSameSite
);
has trOverCache => ( is => 'rw', default => sub { {} } ); has trOverCache => ( is => 'rw', default => sub { {} } );
@ -137,7 +134,7 @@ sub login {
return $self->do( return $self->do(
$req, $req,
[ [
'checkUnauthLogout', 'controlUrl', # Fix 2342 'checkUnauthLogout', 'controlUrl', # Fix 2342
@{ $self->beforeAuth }, $self->authProcess, @{ $self->beforeAuth }, $self->authProcess,
@{ $self->betweenAuthAndData }, $self->sessionData, @{ $self->betweenAuthAndData }, $self->sessionData,
@{ $self->afterData }, $self->validSession, @{ $self->afterData }, $self->validSession,
@ -151,7 +148,7 @@ sub postLogin {
return $self->do( return $self->do(
$req, $req,
[ [
'checkUnauthLogout', 'restoreArgs', # Fix 2342 'checkUnauthLogout', 'restoreArgs', # Fix 2342
'controlUrl', @{ $self->beforeAuth }, 'controlUrl', @{ $self->beforeAuth },
$self->authProcess, @{ $self->betweenAuthAndData }, $self->authProcess, @{ $self->betweenAuthAndData },
$self->sessionData, @{ $self->afterData }, $self->sessionData, @{ $self->afterData },
@ -1042,12 +1039,10 @@ sub tplParams {
} }
return ( return (
MAIN_LOGO => $self->conf->{portalMainLogo},
LANGS => $self->conf->{showLanguages},
SAMESITE => getSameSite(),
SKIN => $self->getSkin($req), SKIN => $self->getSkin($req),
PORTAL_URL => $self->conf->{portal}, PORTAL_URL => $self->conf->{portal},
SKIN_PATH => $portalPath . "skins", SKIN_PATH => $portalPath . "skins",
SAMESITE => getSameSite( $self->conf ),
SKIN_BG => $self->conf->{portalSkinBackground}, SKIN_BG => $self->conf->{portalSkinBackground},
CUSTOM_CSS => $self->conf->{portalCustomCss}, CUSTOM_CSS => $self->conf->{portalCustomCss},
( $self->customParameters ? ( %{ $self->customParameters } ) : () ), ( $self->customParameters ? ( %{ $self->customParameters } ) : () ),