From e31483da9939cec498d6e74dac8437033a742014 Mon Sep 17 00:00:00 2001 From: Konrad Oboza Date: Wed, 29 May 2024 09:04:23 +0200 Subject: [PATCH] IBX-8290: Deprecated `ibexa.rest.refresh_session` route in favor of `ibexa.rest.check_session` (#97) --- src/bundle/Resources/config/routing.yml | 2 +- src/lib/Server/Controller/SessionController.php | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bundle/Resources/config/routing.yml b/src/bundle/Resources/config/routing.yml index 3258cbb8..b2ac808c 100644 --- a/src/bundle/Resources/config/routing.yml +++ b/src/bundle/Resources/config/routing.yml @@ -595,7 +595,7 @@ ibexa.rest.load_content_type_field_definition: requirements: contentTypeId: \d+ fieldDefinitionId: \d+ - + ibexa.rest.load_content_type_field_definition_by_identifier: path: /content/types/{contentTypeId}/fieldDefinition/{fieldDefinitionIdentifier} controller: Ibexa\Rest\Server\Controller\ContentType::loadContentTypeFieldDefinitionByIdentifier diff --git a/src/lib/Server/Controller/SessionController.php b/src/lib/Server/Controller/SessionController.php index e46f2e25..78adba6b 100644 --- a/src/lib/Server/Controller/SessionController.php +++ b/src/lib/Server/Controller/SessionController.php @@ -103,6 +103,8 @@ public function createSessionAction(Request $request) /** * Refresh given session. * + * @deprecated 4.6.7 The "SessionController::refreshSessionAction()" method is deprecated, will be removed in 5.0. Use SessionController::checkSessionAction() instead. + * * @param string $sessionId * * @throws \Ibexa\Contracts\Rest\Exceptions\NotFoundException @@ -111,6 +113,12 @@ public function createSessionAction(Request $request) */ public function refreshSessionAction($sessionId, Request $request) { + trigger_deprecation( + 'ibexa/rest', + '4.6.7', + sprintf('The %s() method is deprecated, will be removed in 5.0.', __METHOD__) + ); + $session = $request->getSession(); if ($session === null || !$session->isStarted() || $session->getId() != $sessionId || !$this->hasStoredCsrfToken()) {