fix(worker-auth): unify token checks and bind job environment

This commit is contained in:
Gabriel Brown
2026-07-10 17:06:33 -04:00
parent feb3723753
commit 020ffbfb23
6 changed files with 138 additions and 37 deletions
@@ -71,6 +71,7 @@ export const getRawEnvironmentForJobInternal = internalQuery({
handler: async (ctx, { jobId }) => {
const job = await ctx.db.get(jobId);
if (!job) return null;
if (!job.claimedBy) return null; // only a claimed job's env is exposed
const ownerId = job.ownerId;
const [user, settings, files] = await Promise.all([
ctx.db.get(ownerId),