auth_pattern
Returns the canonical authentication snippet for the connected backend, so the agent never hand-rolls JWT verification.
Why this tool exists
JWT verification, session refresh, and protected-route patterns are easy to get subtly wrong. Rather than hope the agent reaches for the right SDK call, auth_pattern returns a short text reminder pointing at the upstream provider's built-in auth helpers. The agent reads it and writes code using those helpers instead of hand-rolling JWT verification.
Example output (Supabase)
When a Supabase backend is connected, the tool returns a one-paragraph reminder of the shape:
Use the Supabase SDK's built-in auth — wrap each handler with the SDK's requireUser / withAuth equivalent. For Supabase: supabase.auth.getUser() on the client, and server-side route handlers verify the bearer JWT via the SDK. Never re-implement JWT verification by hand.
It does not return ready-to-paste code — just the guidance about which SDK helper to reach for. The agent applies that guidance when writing route handlers and client components.
Was this page helpful?