Mark a request as being stateful if a cookie for the session is provided at all

This accounts for poorly configured API clients that try to use cookies for authentication purposes. Treat everything with a session cookie as being a stateful request from the front-end.
This commit is contained in:
DaneEveritt 2022-05-22 16:50:36 -04:00
parent 33bafe9277
commit 0fa33e0438
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 61 additions and 4 deletions

View file

@ -179,9 +179,9 @@ class Handler extends ExceptionHandler
)),
];
$converted = self::convertToArray($exception)['errors'][0];
$converted = $this->convertExceptionToArray($exception)['errors'][0];
$converted['detail'] = $error;
$converted['meta'] = is_array($converted['meta'] ?? null) ? array_merge($converted['meta'], $meta) : $meta;
$converted['meta'] = array_merge($converted['meta'] ?? [], $meta);
$response[] = $converted;
}