stechstudio / filament-impersonate

Filament plugin that makes it easy to impersonate your users
271 stars 55 forks source link

Crashing when leaving impersonate #53

Closed adamiatro closed 1 year ago

adamiatro commented 1 year ago

Hello, I'm a new Filament user so please excuse me if this is actually entirely my fault!

I've followed the steps to install the package and it works great, except that when I click on the "Leave" button on the banner, the app crashes with the following error.

Symfony\Component\HttpFoundation\Response::setContent(): Argument #1 ($content) must be of type ?string, Illuminate\Routing\Redirector given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Response.php on line 72 I tried setting a different redirect with the backTo() method, and through the .env file but neither worked.

Any idea why this might be happening?

Thanks!

abdulmejidshemsu commented 1 year ago

I am facing similar issue

jszobody commented 1 year ago

Can you show me how you are configuring the impersonate action?

abdulmejidshemsu commented 1 year ago

it was from my code and not the package, I was using a global scope on the User model that was preventing to get the User on impersonate leave, after handling the scope in another way, the impersonate leave is working correctly.

Thanks

jszobody commented 1 year ago

Glad to hear it's resolved. @adamiatro if you're still having trouble, please provide more information. I suspect that it's not an issue with this package.