diff --git a/Dockerfile b/Dockerfile index abe4498..5ccd131 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,6 @@ WORKDIR /repo COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./ COPY apps/web/package.json apps/web/package.json COPY packages/db/package.json packages/db/package.json -COPY packages/api-types/package.json packages/api-types/package.json RUN pnpm install --frozen-lockfile # ---- migrator: applies drizzle migrations + seeds tier definitions ---- @@ -23,7 +22,6 @@ WORKDIR /repo COPY --from=deps /repo/node_modules ./node_modules COPY --from=deps /repo/apps/web/node_modules ./apps/web/node_modules COPY --from=deps /repo/packages/db/node_modules ./packages/db/node_modules -COPY --from=deps /repo/packages/api-types/node_modules ./packages/api-types/node_modules COPY . . # apps/web/.env.local is normally a symlink to repo-root .env.local (gitignored); # it doesn't exist in the build context, so Next's env loader chokes on the dangling diff --git a/apps/web/middleware.ts b/apps/web/middleware.ts deleted file mode 100644 index 7615af3..0000000 --- a/apps/web/middleware.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { NextRequest, NextResponse } from "next/server"; -import { getSessionCookie } from "better-auth/cookies"; - -// Guards the (app) and admin route groups. This only checks for the -// presence/validity-shape of the Better Auth session cookie — it does NOT -// hit the DB. Per-route handlers (and the admin layout) still perform the -// authoritative session/role checks server-side; this is a fast redirect -// for the common unauthenticated case. -export function middleware(request: NextRequest) { - const sessionCookie = getSessionCookie(request); - - if (!sessionCookie) { - const loginUrl = new URL("/login", request.url); - loginUrl.searchParams.set("redirect", request.nextUrl.pathname); - return NextResponse.redirect(loginUrl); - } - - return NextResponse.next(); -} - -export const config = { - matcher: [ - "/recipes/:path*", - "/explore", - "/search", - "/settings/:path*", - "/feed", - "/pantry", - "/messages/:path*", - "/shopping-lists/:path*", - "/u/:path*", - "/people/:path*", - "/collections/:path*", - "/meal-plan/:path*", - "/admin/:path*", - ], -};