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:
parent
33bafe9277
commit
0fa33e0438
3 changed files with 61 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue