diff --git a/lib/supabase/middleware.ts b/lib/supabase/middleware.ts index 1604c629..432c7594 100644 --- a/lib/supabase/middleware.ts +++ b/lib/supabase/middleware.ts @@ -42,18 +42,6 @@ export async function updateSession(request: NextRequest) { // Get the pathname const pathname = request.nextUrl.pathname - // Salary feature is temporarily disabled in production — block page and API - // routes. Sidebar links render as "Kommer snart" and direct URL access is - // blocked. Local dev (NODE_ENV === 'development') keeps everything enabled - // so we can continue building the feature. - const SALARY_DISABLED = process.env.NODE_ENV !== 'development' - if (SALARY_DISABLED && (pathname === '/salary' || pathname.startsWith('/salary/') || pathname.startsWith('/api/salary/'))) { - if (pathname.startsWith('/api/')) { - return NextResponse.json({ error: 'Lön är inte tillgängligt ännu.' }, { status: 404 }) - } - return NextResponse.redirect(new URL('/', request.url)) - } - // If the refresh token is stale/invalid, clear the session cookies // so the browser stops sending them on every request. // Skip on auth routes — the callback needs PKCE cookies intact. diff --git a/middleware.ts b/middleware.ts index fef440ea..8f2903b8 100644 --- a/middleware.ts +++ b/middleware.ts @@ -16,8 +16,5 @@ export const config = { * - Static assets (images, scripts, manifest, icons, etc.) */ '/((?!_next/static|_next/image|favicon.ico|api|\\.well-known|sw\\.js|sw-register\\.js|manifest\\.json|icons/|.*\\.(?:svg|png|jpg|jpeg|gif|webp|ico|js|json)$).*)', - // Also run on /api/salary/* so the feature-gate block reaches those - // routes (they're disabled while the salary module is "Kommer snart"). - '/api/salary/:path*', ], }