Skip to content

Commit

Permalink
Aligned SessionController with Symfony 6
Browse files Browse the repository at this point in the history
  • Loading branch information
alongosz committed Nov 20, 2024
1 parent 4d65580 commit 436aa47
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/lib/Server/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,10 @@ public function createSessionAction(Request $request): RestValue
}
}

/**
* @return \Ibexa\Rest\Server\Values\UserSession|\Symfony\Component\HttpFoundation\Response
*/
public function checkSessionAction(Request $request)
public function checkSessionAction(Request $request): Values\UserSession|Response
{
$session = $request->getSession();
if ($session === null || !$session->isStarted()) {
if (!$session->isStarted()) {
return $this->logout($request);
}

Expand All @@ -99,9 +96,7 @@ public function checkSessionAction(Request $request)
/**
* Refresh given session.
*
* @deprecated 4.6.7 The "SessionController::refreshSessionAction()" method is deprecated, will be removed in the next API version. Use SessionController::checkSessionAction() instead.
*
* @throws \Ibexa\Core\Base\Exceptions\UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\UnauthorizedException
* @throws \Ibexa\Contracts\Core\Repository\Exceptions\NotFoundException
*/
public function refreshSessionAction(string $sessionId, Request $request): Values\UserSession|Response
Expand All @@ -114,7 +109,7 @@ public function refreshSessionAction(string $sessionId, Request $request): Value

$session = $request->getSession();

if ($session === null || !$session->isStarted() || $session->getId() !== $sessionId || !$this->hasStoredCsrfToken()) {
if (!$session->isStarted() || $session->getId() !== $sessionId || !$this->hasStoredCsrfToken()) {
return $this->logout($request);
}

Expand Down

0 comments on commit 436aa47

Please sign in to comment.