mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-09 18:06:54 +01:00
* [FIX] Fixed issue when a session is expired and an item view request is performed.
This commit is contained in:
@@ -572,18 +572,6 @@ class ItemShowController extends ControllerBase implements ActionsInterface, Ite
|
||||
$this->JsonResponse->setStatus(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Comprobar si la sesión está activa
|
||||
*
|
||||
* @throws \SP\Core\Exceptions\SPException
|
||||
*/
|
||||
protected function checkSession()
|
||||
{
|
||||
if (!Init::isLoggedIn()) {
|
||||
Util::logout();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Obtener los datos para la vista de archivos de una cuenta
|
||||
*
|
||||
|
||||
@@ -29,7 +29,9 @@ use SP\Core\Messages\LogMessage;
|
||||
use SP\Core\SessionUtil;
|
||||
use SP\Http\JsonResponse;
|
||||
use SP\Http\Request;
|
||||
use SP\Util\Checks;
|
||||
use SP\Util\Json;
|
||||
use SP\Util\Util;
|
||||
|
||||
/**
|
||||
* Class RequestControllerTrait
|
||||
@@ -119,9 +121,13 @@ trait RequestControllerTrait
|
||||
protected function checkSession()
|
||||
{
|
||||
if (!Init::isLoggedIn()) {
|
||||
$this->JsonResponse->setDescription(__('La sesión no se ha iniciado o ha caducado', false));
|
||||
$this->JsonResponse->setStatus(10);
|
||||
Json::returnJson($this->JsonResponse);
|
||||
if (Checks::isJson()) {
|
||||
$this->JsonResponse->setDescription(__('La sesión no se ha iniciado o ha caducado', false));
|
||||
$this->JsonResponse->setStatus(10);
|
||||
Json::returnJson($this->JsonResponse);
|
||||
} else {
|
||||
Util::logout();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user