deep-jade•3y ago
user
when i am logged in, I am trying to see my profile page. however, when i console.log the user, I get undefined. it seems like the useGetIdentity hook is not working as the authrprovider is there. The code is in the first image. When I go into the index.ts file of the hook, there seems to be an error in the promise rules, in the 2nd image. im sure my compiler is running 'es next' so i'm not sure what to do.
19 Replies
Hi @jamalwilkenz. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Hmm, I don't know enough to give you a confident answer yet. However, I can provide you with some information about the
useGetIdentity hook and how it works with the authProvider.
The useGetIdentity hook calls the getIdentity method from the authProvider under the hood. It returns the result of react-query's useQuery, which includes properties like isSuccess, isError, and data. The data resolved from the getIdentity method will be returned as the data in the query result. You can find more information about the useGetIdentity hook in the documentation (https://refine.dev/docs/api-reference/core/hooks/auth/useGetIdentity/).
Make sure your authProvider has the getIdentity method implemented correctly, as shown in this example (https://refine.dev/docs/tutorial/understanding-authprovider/create-authprovider).
If you're still having issues, I recommend checking the refine documentation (https://refine.dev/docs) and blog (https://refine.dev/blog) for more information and examples.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------Overview | refine
What is refine?
Blog | refine
A Docusaurus powered blog!
<@650528201663315979> kapa.ai is still learning and improving, please let us how it did by reacting below
genetic-orange•3y ago
Hi, can you share with us network payload, headers, and response from the browser's dev tools ?
deep-jadeOP•3y ago



genetic-orange•3y ago
I'm still trying to figure out.
Can u share us with your auth provider for debugging?
deep-jadeOP•3y ago
it is v3LegacyAuthProvider
v3LegacyAuthProviderCompatible
deep-jadeOP•3y ago

genetic-orange•3y ago
i mean your auth provider, you give refine component probably in app.tsx
i don't think problem is on useGetIdentity. Because our examples and tests are working and no bug reported
deep-jadeOP•3y ago

deep-jadeOP•3y ago

genetic-orange•3y ago
but i need to see getUserIdentity function
deep-jadeOP•3y ago

genetic-orange•3y ago
Btw. it's Getting late here in where where i live. i will check this issue in the morning. Meanwhile i hope someone will help
Do you have user on your localstorage ? 🤔 useGetIdentity calls getUserIdentity function
deep-jadeOP•3y ago
yes, because i am able to create an order using my user and am able to log it here

deep-jadeOP•3y ago
user does not show undefined when i am creating, but i am unable to update using the same user creds
and that shows as undefined
deep-jadeOP•3y ago
could you let me know how i can access backwards compatibility for refine? I believe it might be an error due to the LegacyAuth not being deprecated as you can see here. or if could let me know where I can change the lib compiler

deep-jadeOP•3y ago
*being deprecated
genetic-orange•3y ago
you can change target from tsconfig
https://www.typescriptlang.org/tsconfig#target
this is not a problem. this is a typescript error and not will be issue on runtime. your code already running
i suggest you to debug with logs authProvider.getUserIdentity method