Closed jfthuillier closed 3 years ago
So we need to explicitly set it if we use authentication?
I guess so, not sure why it is not initialized here : https://github.com/marmelab/react-admin/blob/master/packages/ra-core/src/core/CoreAdminUI.tsx#L59
It is in the AdminUI
: https://github.com/marmelab/react-admin/blob/b1a66701d79ba739bddf42b7722fac0873f53464/packages/react-admin/src/AdminUI.tsx#L17
I don't think we should disable it by default. I think React Admin has made the choice to have it by default because an admin is very often used with authentication. And we should probably do the same.
However maybe we could disable the user menu (not just the logout button) if there is no auth provider? I think it should be doable with the useAuthProvider
hook (I think it can be used inside the AdminResourcesGuesser
since the admin context is a parent).
I did not manage to use the hook inside the AdminResourcesGuesser
but i have used it in the AppBar
to set the userMenu
value. WDYT ?
Yes why not :slightly_smiling_face: It just means that whenever the user changes the default AppBar
, it will have a user menu.
Out of curiosity, why it was not working in the AdminResourcesGuesser
?
I did not find a property i could use at this level, that's why i had to change the behavior directly in the AppBar
Thank you again @jfthuillier.
Even when no
authProvider
is configured, the user menu was displayed.