fucking revert

This commit is contained in:
Adam Cohen Hillel 2025-04-18 01:00:04 +01:00
parent 37d253d13e
commit 963d930125
3 changed files with 2 additions and 13 deletions

View File

@ -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

View File

@ -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

View File

@ -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).*)'],
};