You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar to the issue reported in #75, I'm experiencing it as well.
Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string, Illuminate\Routing\Redirector given, called in [redacted]/vendor/laravel/framework/src/Illuminate/Http/Response.php on line 73
This is only happening in my case because I have a middleware.
public function handle(Request $request, Closure $next): Response
{
if(!empty(auth()->user())){
// session value set on login
setPermissionsTeamId(auth()->user()->org_id);
}
return $next($request);
}
The error is triggered by the return call within this middleware. Since the Impersonator is returning a redirect response, it doesn't seem to work with the way Laravel 11 middlewares are created.
Any thoughts?
The text was updated successfully, but these errors were encountered:
It's quite common for a Laravel controller method to return a redirect, that's supported and well documented. Returning a redirect works just fine with Laravel middleware, in general.
Something else is going on here that isn't apparent from the snippet of code you've shared. You'll need to do further debugging and troubleshooting to see what's really going on.
Similar to the issue reported in #75, I'm experiencing it as well.
This is only happening in my case because I have a middleware.
The error is triggered by the
return
call within this middleware. Since the Impersonator is returning a redirect response, it doesn't seem to work with the way Laravel 11 middlewares are created.Any thoughts?
The text was updated successfully, but these errors were encountered: