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
other-emerald•2y ago
Hi, can you share with us network payload, headers, and response from the browser's dev tools ?
fascinating-indigo•2y ago
other-emerald•2y ago
I'm still trying to figure out.
Can u share us with your auth provider for debugging?
fascinating-indigo•2y ago
it is v3LegacyAuthProvider
v3LegacyAuthProviderCompatible
fascinating-indigo•2y ago
other-emerald•2y 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
fascinating-indigo•2y ago
fascinating-indigo•2y ago
other-emerald•2y ago
but i need to see getUserIdentity function
fascinating-indigo•2y ago
other-emerald•2y 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
fascinating-indigo•2y ago
yes, because i am able to create an order using my user and am able to log it here