fair-rose
fair-rose14mo 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.
No description
No description
19 Replies
kapa.ai
kapa.ai14mo ago
Hi @jamalwilkenz. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai14mo ago
---------------------- 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!
kapa.ai
kapa.ai14mo ago
<@650528201663315979> kapa.ai is still learning and improving, please let us how it did by reacting below
fascinating-indigo
fascinating-indigo14mo ago
Hi, can you share with us network payload, headers, and response from the browser's dev tools ?
fair-rose
fair-rose14mo ago
No description
No description
No description
fascinating-indigo
fascinating-indigo14mo ago
I'm still trying to figure out. Can u share us with your auth provider for debugging?
fair-rose
fair-rose14mo ago
it is v3LegacyAuthProvider v3LegacyAuthProviderCompatible
fair-rose
fair-rose14mo ago
No description
fascinating-indigo
fascinating-indigo14mo 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
fair-rose
fair-rose14mo ago
No description
fair-rose
fair-rose14mo ago
No description
fascinating-indigo
fascinating-indigo14mo ago
but i need to see getUserIdentity function
fair-rose
fair-rose14mo ago
No description
fascinating-indigo
fascinating-indigo14mo 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
fair-rose
fair-rose14mo ago
yes, because i am able to create an order using my user and am able to log it here
No description
fair-rose
fair-rose14mo 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
fair-rose
fair-rose14mo 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
No description
fair-rose
fair-rose14mo ago
*being deprecated
fascinating-indigo
fascinating-indigo14mo 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