Edge Function returns 401 Invalid JWT before execution (Verify JWT OFF, no logs)
edge functions
Hi everyone Iβm stuck with an Edge Functions issue and could really use some help.
TL;DR Edge Function always returns 401 Invalid JWT BEFORE execution. Verify JWT is OFF. No logs. Auth + REST work fine.
Details: - Supabase Edge Function:
enter-matching
enter-matching
- Client: Flutter (Dart), Magic Link auth - Error: 401 Invalid JWT - Happens BEFORE function runs: - No console logs at all - Invocations are counted in dashboard - Verify JWT is OFF - Same behavior with: - supabase.functions.invoke(...) - raw HTTP POST to /functions/v1/enter-matching - Minimal function (
return { ok: true }
return { ok: true }
) also fails - Function redeployed multiple times
Headers sent on every request: - Authorization: Bearer <access_token> - apikey: <anon_key> - Content-Type: application/json
What works: - Auth (Magic Link) works - PostgREST works with the same access token - Session + JWT look valid
Observations: This looks like the Edge Functions gateway rejecting the request before the function executes, not a bug in function code.
Questions: 1. Can Edge Functions return 401 Invalid JWT before execution even when Verify JWT is OFF? 2. Could recent Supabase maintenance affect Edge Functions auth/gateway only? 3. Could this be project-level corruption or config? 4. Would creating a new project be a reasonable workaround?
Happy to share project ref or screenshots if needed. Thanks a lot
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.