use sendJSONresponse instead of handcrafting portal response
This commit is contained in:
parent
c645479800
commit
2440fc7866
|
@ -260,11 +260,15 @@ sub do {
|
||||||
if ( !$self->conf->{noAjaxHook} and $req->wantJSON ) {
|
if ( !$self->conf->{noAjaxHook} and $req->wantJSON ) {
|
||||||
$self->logger->debug('Processing to JSON response');
|
$self->logger->debug('Processing to JSON response');
|
||||||
if ( ( $err > 0 and !$req->id ) or $err eq PE_SESSIONNOTGRANTED ) {
|
if ( ( $err > 0 and !$req->id ) or $err eq PE_SESSIONNOTGRANTED ) {
|
||||||
return [
|
return $self->sendJSONresponse(
|
||||||
401,
|
$req,
|
||||||
[ 'WWW-Authenticate' => "SSO " . $self->conf->{portal} ],
|
{ result => 0, error => $err },
|
||||||
[qq'{"result":0,"error":$err}']
|
code => 401,
|
||||||
];
|
headers => [
|
||||||
|
'WWW-Authenticate' => "SSO " . $self->conf->{portal},
|
||||||
|
"Content-Type" => "application/javascript"
|
||||||
|
],
|
||||||
|
);
|
||||||
}
|
}
|
||||||
elsif ( $err > 0 and $err != PE_PASSWORD_OK and $err != PE_LOGOUT_OK ) {
|
elsif ( $err > 0 and $err != PE_PASSWORD_OK and $err != PE_LOGOUT_OK ) {
|
||||||
return $self->sendJSONresponse(
|
return $self->sendJSONresponse(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user