Skip to content

PR #106: getUserIdFromRequest in supabase.ts still uses || "" pattern and creates a new client per call — dead code, should be removed #124

@bmersereau

Description

@bmersereau

Problem

During review of PR #106, the batch reviewer identified that getUserIdFromRequest in backend/src/lib/supabase.ts was not updated as part of the env-guard fix. The function:

  • Still uses the old || "" pattern for env vars
  • Creates a fresh createClient on every call (no singleton)
  • Has zero callers in the codebase — it is dead code

Since it is exported, leaving it in place risks it being wired to a route in the future with broken behavior.

Fix

Remove getUserIdFromRequest from supabase.ts entirely. Auth is handled by requireAuth middleware (auth.ts) which already uses the singleton pattern.

Affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions