phpsa / filament-authentication

MIT License
113 stars 24 forks source link

ImpersonateLink return error #47

Closed imknight closed 9 months ago

imknight commented 10 months ago

The return type of ImpersonateLink:: impersonate() is wrong, getting this error "Phpsa\FilamentAuthentication\Actions\ImpersonateLink::impersonate(): Return value must be of type Livewire\Redirector|Illuminate\Http\RedirectResponse|bool, Livewire\Features\SupportRedirects\Redirector returned"

chrispian commented 10 months ago

Having the same issue. Haven't found the root cause yet. I looked at Impersonate, nothing in their issues at the moment related to this.

@imknight Are you using SSO or any other special login with yours? We are using SSO and I'm not sure if impersonate broke with SSO or with the latest updates (Laravel 10, Filament 3, Livewire 3, etc.)

I'm working on this issue myself now trying to figure it out.

imknight commented 10 months ago

I was able to replace action with my own action, but now I've hit another roadblock. It seems that a specific part is still using the Filament v2 config method, and I think the impersonate feature is broken. I replaced it with another impersonate package, which you can find at https://github.com/stechstudio/filament-impersonate.

chrispian commented 10 months ago

Thanks, I saw that package too. I'll swap them out and go from there. Good find.

chrispian commented 10 months ago

@imknight Since the UserResource is part of this plugin, did you end up creating your own so you could add the action to the table there? Or can you add an action to a resource another way (I'm looking into both right now). If I switch to the other plugin it seems to require manually adding things in a few places including the table action and edit user resource, etc. So just curious if you found a way add to the one here or did you go all custom?

chrispian commented 10 months ago

FYI, I just went with creating my own resource. Works great. Thanks for the tip on that plugin. We use Impersonate to debug user issues and confirm permissions, views, etc. all the time.

imknight commented 10 months ago

@chrispian ya, using my own user resource, I added the action from the package. Since the only way to impersonate is through the user list, it's not a problem for me.

phpsa commented 10 months ago

Will be invesigatingf this this week

chrispian commented 10 months ago

@imknight That's what I ended up doing too.

@phpsa I'm happy to test once you get something ready. I appreciate you adding the ability to override that easily too. I'll switch back to yours once it's sorted. If I get time this week I'll try to dig around and see what's going on too.