Cleaning unuseful code & append comments (#1431)

This commit is contained in:
Christophe Maudoux 2018-09-23 11:07:58 +02:00
parent d4d41d124c
commit f4b17c7c8a

View File

@ -518,6 +518,8 @@ sub mkOidcConsent {
if ( defined( $self->conf->{oidcRPMetaDataOptions} ) if ( defined( $self->conf->{oidcRPMetaDataOptions} )
and ref( $self->conf->{oidcRPMetaDataOptions} ) ) and ref( $self->conf->{oidcRPMetaDataOptions} ) )
{ {
# Set default RP displayname
foreach my $oidc ( keys %{ $self->conf->{oidcRPMetaDataOptions} } ) { foreach my $oidc ( keys %{ $self->conf->{oidcRPMetaDataOptions} } ) {
$self->conf->{oidcRPMetaDataOptions}->{$oidc} $self->conf->{oidcRPMetaDataOptions}->{$oidc}
->{oidcRPMetaDataOptionsDisplayName} ||= $oidc; ->{oidcRPMetaDataOptionsDisplayName} ||= $oidc;
@ -525,10 +527,10 @@ sub mkOidcConsent {
} }
# Loading existing oidcConsents # Loading existing oidcConsents
$self->logger->debug("Loading OIDC Consents ..."); $self->logger->debug("Searching OIDC Consents...");
my $_consents; my $_oidcConsents;
if ( exists $session->{_oidcConsents} ) { if ( exists $session->{_oidcConsents} ) {
$_consents = eval { $_oidcConsents = eval {
from_json( $session->{_oidcConsents}, { allow_nonref => 1 } ); from_json( $session->{_oidcConsents}, { allow_nonref => 1 } );
}; };
if ($@) { if ($@) {
@ -538,14 +540,9 @@ sub mkOidcConsent {
} }
else { else {
$self->logger->debug("No OIDC Consent found"); $self->logger->debug("No OIDC Consent found");
#$_oidcConsents = [];
} }
my $consents = {}; my $consents = {};
##################### foreach (@$_oidcConsents) {
foreach (@$_consents) {
if ( defined $_->{rp} ) { if ( defined $_->{rp} ) {
my $rp = $_->{rp}; my $rp = $_->{rp};
$self->logger->debug("RP { $rp } Consent found"); $self->logger->debug("RP { $rp } Consent found");
@ -557,18 +554,7 @@ sub mkOidcConsent {
} }
} }
#foreach ( keys %$session ) { # Display existing oidcConsents
#if ( $_ =~ /_oidc_consent_time_(.+)$/ ) {
#$consents->{$1}->{time} = $session->{ "_oidc_consent_time_" . $1 };
#$consents->{$1}->{scope} =
#$session->{ "_oidc_consent_scope_" . $1 };
#$consents->{$1}->{displayName} =
#$self->conf->{oidcRPMetaDataOptions}->{$1}
#->{oidcRPMetaDataOptionsDisplayName};
#}
#}
#####################
return $self->loadTemplate( return $self->loadTemplate(
'oidcConsents', 'oidcConsents',
params => { params => {