Adapt GrantSession plugin to display authentication error on login form (#1666)

This commit is contained in:
Clément OUDOT 2019-03-18 11:53:30 +01:00
parent 627548e95d
commit 4366488fb6
2 changed files with 10 additions and 5 deletions

View File

@ -45,7 +45,12 @@ sub run {
}
# Avoid display notification if AuthResult is not null
return PE_BADCREDENTIALS if $req->authResult > PE_OK;
if ( $req->authResult > PE_OK ) {
$self->logger->debug(
"Bad authentication, do not check grant session rules");
$req->userData( {} );
return PE_BADCREDENTIALS;
}
foreach ( sort sortByComment keys %{ $self->rules } ) {
$self->logger->debug( "Grant session condition -> "

View File

@ -54,8 +54,8 @@ ok( $res->[2]->[0] =~ /<span trmsg="5"><\/span><\/div>/,
'dwho rejected with PE_BADCREDENTIALS' )
or print STDERR Dumper( $res->[2]->[0] );
count(1);
ok( $res->[2]->[0] =~ m%<span trspan="goToPortal">Go to portal</span>%,
'Found goToPortal button' )
ok( $res->[2]->[0] =~ m%<span trspan="connect">Connect</span>%,
'Found connect button' )
or print STDERR Dumper( $res->[2]->[0] );
count(1);
@ -125,8 +125,8 @@ ok(
'rtyler rejected with PE_BADCREDENTIALS'
) or print STDERR Dumper( $res->[2]->[0] );
count(1);
ok( $res->[2]->[0] =~ m%<span trspan="goToPortal">Go to portal</span>%,
'Found goToPortal button' )
ok( $res->[2]->[0] =~ m%<span trspan="connect">Connect</span>%,
'Found connect button' )
or print STDERR Dumper( $res->[2]->[0] );
count(1);