#Custom Auth With Kinde

4 messages · Page 1 of 1 (latest)

novel kettle
#

I am working on a Nextjs project with Kinde for authentication and Convex for my backend. I am implementing custom auth by integrating Kinde. I have created my own custom auth provider to use with Kinde. The convex client seems not to fetch the JWT token although setAuth is called on the convex client. I get a null response when trying to log the user's identity to the client while a user is logged in.

What am I doing wrong here?

quiet lantern
#

convex needs to be outside the ConvexProviderWithAuth component (in module scope): Otherwise you get a new Convex client on every render;

useKindeBrowserClient needs to be inside useAuthFromKinde hook implementation, otherwise it's not a real hook and won't react to the changes from Kinde's client.

novel kettle
#

Thanks for the feedback. I have done what you suggested but the JWT token is still not being fetched by the convex client.

quiet lantern