StoicWanderer
StoicWanderer•14mo ago

getUserIdentity problem!

Hello everyone, My concern is about ctx.auth.getUserIdentity, meaning i dont understand when does this function get the user data from Clerk? I sign-up and i call the storeUser function example from the docs, but i call it in a nextjs client component with useEffect and says i'm not authenticated. It worked once when i tried in an if block with useConvexAuth's isAuthenticated, but it's not working anymore. Also tried using in the if block with Clerk's isSignedIn, same, for one signup worked, then next instance not working How could i solve this?
5 Replies
StoicWanderer
StoicWandererOP•14mo ago
BUMP! Once it's working once it's not. What's the matter here? I keep using if blocks, do i need to use await?
RJ
RJ•14mo ago
Hey @StoicWanderer, could you share the code where you're configuring Clerk? I'm not familiar with Next.js as I use Remix, but might still be able to help.
StoicWanderer
StoicWandererOP•14mo ago
I was trying out a websocket system where i query data from Convex into the UI and I tried using the same browser for two different user instances and Clerk and Convex wans't having it, so i needed to download another browser to test the multi functionality, as i'm devloping a chat for users. So, its all good now. I really hope, But thank you @RJ for offering your help 🙂
RJ
RJ•14mo ago
Ah ok, interesting. Let us know if you run into any more trouble!
ian
ian•14mo ago
For chrome you can test using different "identities" and with most browsers you can open "incognito" or "private" windows to separate logged in users - they use localStorage, cookies, etc for auth, which don't persist across private tabs & separate google identities

Did you find this page helpful?