Igor KotuaI
Convex Community2y ago
14 replies
Igor Kotua

Issues with getUserIdentity inside queries (auth with Clerk)

Hi there

I configured login with Clerk and set up integration with Convex.

getUserIdentity works fine inside mutations (returning identity object), but inside queries it's almost always emtpy. I am using Next.js.

I am also using Clerk middleware for app router.

The weird thing I noticed is when I navigate to a page with a query via Next.js router.push() the query works fine and user identity is not null. But if I refresh this page or try to navigate to it just via URL, the user identity will be empty.

What am I doing wrong?
Was this page helpful?