Open thibault-barrat opened 2 months ago
Thanks for this report!
Providing no redirectTo
is currently not supported, but it would be nice if it was!
I'll label this issue as enhancement (and good first issue). Thanks!
I had fixed it in https://github.com/marmelab/react-admin/pull/10177. Could you please assign it to me ?
@rktamil No need to assign the issue. Referencing the issue number in your PR description is enough. Thank you for contributing!
What you were expecting: I would like to notify user when
getPermissions
request is failing. To do it, I catch the error incheckError
and I reject promise withlogoutUser: false
and withoutredirectTo
as I just want to display a notification without logout or redirect the userWhat happened instead: The notification is correctly displayed but I have a JS error:
This comes from
useLogoutIfAccessDenied
: https://github.com/marmelab/react-admin/blob/75a6683c9a64d6190ddde88d043b8e15b48c39e6/packages/ra-core/src/auth/useLogoutIfAccessDenied.ts#L103-L113Steps to reproduce: Update
getPermissions
andcheckError
with following code:Environment