Unauthenticated logout (#2342)
This commit is contained in:
parent
2d2bcac4a7
commit
b2306cc8ad
|
@ -179,6 +179,24 @@ sub checkLogout {
|
||||||
PE_OK;
|
PE_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub checkUnauthLogout {
|
||||||
|
my ( $self, $req ) = @_;
|
||||||
|
if ( defined $req->param('logout') ) {
|
||||||
|
$req->pdata({});
|
||||||
|
$req->addCookie(
|
||||||
|
$self->cookie(
|
||||||
|
name => $self->conf->{cookieName},
|
||||||
|
domain => $self->conf->{domain},
|
||||||
|
secure => $self->conf->{securedCookie},
|
||||||
|
expires => 'Wed, 21 Oct 2015 00:00:00 GMT',
|
||||||
|
value => 0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$req->steps( [ sub { PE_LOGOUT_OK } ] );
|
||||||
|
}
|
||||||
|
PE_OK;
|
||||||
|
}
|
||||||
|
|
||||||
sub authLogout {
|
sub authLogout {
|
||||||
my ( $self, $req ) = @_;
|
my ( $self, $req ) = @_;
|
||||||
my $res = $self->_authentication->authLogout($req);
|
my $res = $self->_authentication->authLogout($req);
|
||||||
|
@ -349,7 +367,7 @@ sub authenticate {
|
||||||
$req->steps( [
|
$req->steps( [
|
||||||
'setSessionInfo', 'setMacros',
|
'setSessionInfo', 'setMacros',
|
||||||
'setPersistentSessionInfo', 'storeHistory',
|
'setPersistentSessionInfo', 'storeHistory',
|
||||||
@{ $self->afterData }, sub { PE_BADCREDENTIALS }
|
@{ $self->afterData }, sub { PE_BADCREDENTIALS }
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#
|
#
|
||||||
package Lemonldap::NG::Portal::Main::Run;
|
package Lemonldap::NG::Portal::Main::Run;
|
||||||
|
|
||||||
our $VERSION = '2.0.9';
|
our $VERSION = '2.0.10';
|
||||||
|
|
||||||
package Lemonldap::NG::Portal::Main;
|
package Lemonldap::NG::Portal::Main;
|
||||||
|
|
||||||
|
@ -133,10 +133,11 @@ sub login {
|
||||||
return $self->do(
|
return $self->do(
|
||||||
$req,
|
$req,
|
||||||
[
|
[
|
||||||
'controlUrl', @{ $self->beforeAuth },
|
'checkUnauthLogout', 'controlUrl', # Fix 2342
|
||||||
$self->authProcess, @{ $self->betweenAuthAndData },
|
@{ $self->beforeAuth }, $self->authProcess,
|
||||||
$self->sessionData, @{ $self->afterData },
|
@{ $self->betweenAuthAndData }, $self->sessionData,
|
||||||
$self->validSession, @{ $self->endAuth },
|
@{ $self->afterData }, $self->validSession,
|
||||||
|
@{ $self->endAuth }
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -146,11 +147,11 @@ sub postLogin {
|
||||||
return $self->do(
|
return $self->do(
|
||||||
$req,
|
$req,
|
||||||
[
|
[
|
||||||
'restoreArgs', 'controlUrl',
|
'checkUnauthLogout', 'restoreArgs', # Fix 2342
|
||||||
@{ $self->beforeAuth }, $self->authProcess,
|
'controlUrl', @{ $self->beforeAuth },
|
||||||
@{ $self->betweenAuthAndData }, $self->sessionData,
|
$self->authProcess, @{ $self->betweenAuthAndData },
|
||||||
@{ $self->afterData }, $self->validSession,
|
$self->sessionData, @{ $self->afterData },
|
||||||
@{ $self->endAuth },
|
$self->validSession, @{ $self->endAuth }
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1053,7 +1054,7 @@ sub registerLogin {
|
||||||
}
|
}
|
||||||
|
|
||||||
my $history = $req->sessionInfo->{_loginHistory} ||= {};
|
my $history = $req->sessionInfo->{_loginHistory} ||= {};
|
||||||
my $type = ( $req->authResult > 0 ? 'failed' : 'success' ) . 'Login';
|
my $type = ( $req->authResult > 0 ? 'failed' : 'success' ) . 'Login';
|
||||||
$history->{$type} ||= [];
|
$history->{$type} ||= [];
|
||||||
$self->logger->debug("Current login saved into $type");
|
$self->logger->debug("Current login saved into $type");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user