Problem
src/lib/supabase/middleware.ts exports updateSession(), 38 lines that build a createServerClient and refresh the session. It is not imported anywhere:
$ rg 'updateSession' src
src/lib/supabase/middleware.ts:9:export async function updateSession(request: NextRequest) {
src/proxy.ts:25-44 reimplements the same thing inline (with the correct variant that composes with next-intl).
Impact
Dead auth code, with a docstring asserting that it "refreshes the Supabase session on every request". Anyone reading it will assume it's live. Worse: the filename (middleware.ts) suggests it's the real middleware, when Next 16 renamed the concept to proxy and the actual file is src/proxy.ts.
Suggested direction
Delete src/lib/supabase/middleware.ts.
Found during a full code audit.
Problem
src/lib/supabase/middleware.tsexportsupdateSession(), 38 lines that build acreateServerClientand refresh the session. It is not imported anywhere:src/proxy.ts:25-44reimplements the same thing inline (with the correct variant that composes with next-intl).Impact
Dead auth code, with a docstring asserting that it "refreshes the Supabase session on every request". Anyone reading it will assume it's live. Worse: the filename (
middleware.ts) suggests it's the real middleware, when Next 16 renamed the concept toproxyand the actual file issrc/proxy.ts.Suggested direction
Delete
src/lib/supabase/middleware.ts.Found during a full code audit.