Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) princip

## [Unreleased][unreleased]

### Fixed
- Input validation before authorization check in ApiPresenter (causes issues with some authorization handlers that need to check input params)

## 3.4.0

### Added
Expand Down
11 changes: 6 additions & 5 deletions src/Presenters/ApiPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public function run(Request $request): IResponse
}

$paramsProcessor = new ParamsProcessor($handler->params());

$authResponse = $this->checkAuth($authorization, $paramsProcessor->getValues());
if ($authResponse !== null) {
return $authResponse;
}

if ($paramsProcessor->isError()) {
$response = $this->errorHandler->handleInputParams($paramsProcessor->getErrors());
$this->response->setCode($response->getCode());
Expand All @@ -93,11 +99,6 @@ public function run(Request $request): IResponse

$params = $paramsProcessor->getValues();
Comment thread
Martin-Beranek marked this conversation as resolved.
Outdated

$authResponse = $this->checkAuth($authorization, $params);
if ($authResponse !== null) {
return $authResponse;
}

try {
$response = $handler->handle($params);
$code = $response->getCode();
Expand Down
Loading