From 963d9301257a6a189389aa7ae63ef0a859319bd6 Mon Sep 17 00:00:00 2001 From: Adam Cohen Hillel Date: Fri, 18 Apr 2025 01:00:04 +0100 Subject: [PATCH] fucking revert --- frontend/src/app/dashboard/(personalAccount)/page.tsx | 2 +- frontend/src/lib/supabase/middleware.ts | 2 +- frontend/src/middleware.ts | 11 ----------- 3 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 frontend/src/middleware.ts diff --git a/frontend/src/app/dashboard/(personalAccount)/page.tsx b/frontend/src/app/dashboard/(personalAccount)/page.tsx index 6e07b7d0..d43f8f68 100644 --- a/frontend/src/app/dashboard/(personalAccount)/page.tsx +++ b/frontend/src/app/dashboard/(personalAccount)/page.tsx @@ -15,7 +15,7 @@ export default function PersonalAccountPage() { // Use client-side navigation instead of server redirect useEffect(() => { - router.replace('/dashboard/agents'); + router.replace('/dashboard'); }, [router]); // Return a minimal loading state until redirect happens diff --git a/frontend/src/lib/supabase/middleware.ts b/frontend/src/lib/supabase/middleware.ts index 72012f56..dfeb5fdf 100644 --- a/frontend/src/lib/supabase/middleware.ts +++ b/frontend/src/lib/supabase/middleware.ts @@ -71,7 +71,7 @@ export const validateSession = async (request: NextRequest) => { // https://supabase.com/docs/guides/auth/server-side/nextjs const { data: { user } } = await supabase.auth.getUser(); - const protectedRoutes = ['/invitation']; + const protectedRoutes = ['/dashboard', '/invitation']; if (!user && protectedRoutes.some(path => request.nextUrl.pathname.startsWith(path))) { // redirect to /auth diff --git a/frontend/src/middleware.ts b/frontend/src/middleware.ts deleted file mode 100644 index 98253d22..00000000 --- a/frontend/src/middleware.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { NextRequest, NextResponse } from 'next/server'; -import { validateSession } from './lib/supabase/middleware'; - -export const middleware = (request: NextRequest) => { - return validateSession(request); -}; - -// Apply middleware to all routes -export const config = { - matcher: ['/((?!_next/static|_next/image|favicon.ico|api/webhooks).*)'], -}; \ No newline at end of file