Skip to content

Commit

Permalink
Merge pull request #5209 from marmelab/fix-getidentify-no-authprovider
Browse files Browse the repository at this point in the history
Fix useGetIdentity fails when there is no authProvider
  • Loading branch information
djhi authored Aug 31, 2020
2 parents ede187b + 4c808bc commit bf4097b
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 bf4097b

Please sign in to comment.