Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IBX-8290: Deprecated ibexa.rest.refresh_session route in favor of ibexa.rest.check_session #97

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading