Skip to content

Commit

Permalink
implement changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
michalsn committed Sep 9, 2023
1 parent 3c95f0c commit e25f256
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Security/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,8 @@ private function getPostedToken(RequestInterface $request): ?string
$body = (string) $request->getBody();

if ($body !== '') {
if (! empty($json = json_decode($body)) && json_last_error() === JSON_ERROR_NONE) {
$json = json_decode($body);
if (! empty($json) && json_last_error() === JSON_ERROR_NONE) {
return $json->{$this->config->tokenName} ?? null;
}

Expand Down

0 comments on commit e25f256

Please sign in to comment.