ninjzN
Convex Community10mo ago
8 replies
ninjz

Is auth context passed to scheduled actions from server side queries/mutations?

I'm calling an action within a server side mutation using:

    await ctx.scheduler.runAfter(
      0,
      api.test.testFn,
      testData,
    );


However when trying to retrieve the userIdentity within the action via:
    const identity = await ctx.auth.getUserIdentity();


It returns null.

Is the auth context only passed to the action when the action is called directly from the client? Or am I doing something wrong? I'm using Convex Auth btw.
Was this page helpful?