Replies: 1 comment
-
An I would recommend setting this as a request attribute instead: public function handle(Request $request, Closure $next) {
$tokenData = (new AuthUserService())->getData($request->accessToken);
$request->attributes->set('tokenData', $tokenData);
return $next($request);
} $tokenData = $request->attributes->get('tokenData'); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Database Driver & Version: mysql & 10.7.4-MariaDB-1:10.7.4+maria~focal
Description:
I was trying to add my decoded jwt token to the $request class (inside a middleware)
Steps To Reproduce:
Error:
Expected a scalar, or an array as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::set()", "stdClass" given.
Maybe related: symfony/symfony#44432
Not so great workarounds:
Beta Was this translation helpful? Give feedback.
All reactions