Skip to content

Commit

Permalink
IBX-8290: Deprecated ibexa.rest.refresh_session route in favor of `…
Browse files Browse the repository at this point in the history
…ibexa.rest.check_session` (#97)
  • Loading branch information
konradoboza authored May 29, 2024
1 parent 5316c60 commit e31483d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bundle/Resources/config/routing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions src/lib/Server/Controller/SessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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()) {
Expand Down

0 comments on commit e31483d

Please sign in to comment.