fix: support member expressions in containsAuthCheck
Support member expressions for server auth rule
Fixes this case:
await auth0.getSession() // Currently undetected
// Current workaround
const getSession = async () => await auth0.getSession()
await getSession() // Gets detected
I just added an else if to catch that - small diff.
Closes #239
[!NOTE] Low Risk Low risk, localized change to AST pattern matching for auth-check detection; main risk is minor false positives/negatives in linting rather than runtime behavior.
Overview Updates
containsAuthCheckinserver-auth-actions.tsto treat member-expression calls likeauth0.getSession()(and awaited variants) as valid auth checks, in addition to direct identifier calls such asgetSession().Reviewed by Cursor Bugbot for commit 48965d85ef20a461a8953184bf96d3ffb471e64a. Bugbot is set up for automated code reviews on this repo. Configure here.
🔴 React Review — 0/100 (unchanged) · No new issues
Reviewed by react-review for commit 48965d85ef20a461a8953184bf96d3ffb471e64a. Configure here.
@cr4yfish is attempting to deploy a commit to the Million Team on Vercel.
A member of the Team first needs to authorize it.
Working on a related fix in #261 that uses the existing getCalleeName utility instead of adding a parallel else if branch — it already resolves both Identifier and MemberExpression callees to a single name, so chained members (supabase.auth.getSession()), optional chaining (auth0?.getSession()), and the original Identifier forms all collapse into one check. Thanks for the report and repro — your test case is locked into the regression suite there.