imightbejesusI

Auth0 with convex in vanilla js PWA.

Hello.
I am trying to wire up convex with auth0 in a vanilla js progressive web app.
Docs seem to only cover this for a react app, and I am having trouble getting this to work in vanilla js pwa.
I have added auth.config.ts file with my Auth0 provider (specifying domain and applicationID).
Auth through Auth0 works fine, as I am able to get logged in. In my convex query I added the following check:
handler: async (ctx, args) => {
    const identity = await ctx.auth.getUserIdentity();
    if (identity === null) {
      throw new Error("Unauthenticated call");
    }
}

However the identity in the code above is always null, even though the user is logged in.
What am I missing?
Thanks in advance.
Was this page helpful?