Skip to content

Commit

Permalink
Fix useGetIdentity fails when there is no authProvider
Browse files Browse the repository at this point in the history
closes #5201
  • Loading branch information
fzaninotto committed Aug 31, 2020
1 parent d580844 commit 4c808bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/ra-core/src/auth/useGetIdentity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const useGetIdentity = () => {
});
const authProvider = useAuthProvider();
useEffect(() => {
if (typeof authProvider.getIdentity === 'function') {
if (authProvider && typeof authProvider.getIdentity === 'function') {
const callAuthProvider = async () => {
try {
const identity = await authProvider.getIdentity();
Expand Down

0 comments on commit 4c808bc

Please sign in to comment.