Action->canSee() failing with Nova 4 upgrade
Hey guys,
I was previously setting an action canSee() as the following:
public function actions(NovaRequest $request)
{
return [
(new RemoveTwoFactor())
->onlyOnTableRow()
->canSee(function() {
return !!$this->two_factor_enabled;
})
];
}
This worked fine in Nova 3. Now with the Nova 4 upgrade, I keep getting a 403 error.
What the action does is remove the two factor authentication. And the link to this action is only shown if the user has two factor authentication set up. It seems that this is somehow broken with the Nova 4 upgrade.
Digging into the ActionController and the ActionRequest, I can see that $this->availableActions() is set to NULL when I return $this->two_factor_enabled. However, if I return true, it works fine. The only issue here is that the link is now shown for all users in the table, even those without 2FA.
Any idea how I can get it to show only for those users but still be available for these same users?
Thanks!
Please or to participate in this conversation.