stefanoS
Convex Community2y ago
19 replies
stefano

Eliminating redundant auth checks

hi, I'm repeating this piece of code in basically every convex function to check if the user is logged in (first check before any other check for authorizations).

is this best practice? (I'm using Clerk)

    const identity = await ctx.auth.getUserIdentity();
    if (!identity) {
      return [];
    }
Was this page helpful?