From 7d704fd6c47fccc10b6e636bbd2885c5937263e4 Mon Sep 17 00:00:00 2001 From: patrickwebsdev Date: Sat, 9 Nov 2024 03:52:55 -0300 Subject: [PATCH] fix: code quality checks --- src/lib/supabase/middleware.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/lib/supabase/middleware.ts b/src/lib/supabase/middleware.ts index a0bbaf3..b689d45 100644 --- a/src/lib/supabase/middleware.ts +++ b/src/lib/supabase/middleware.ts @@ -38,16 +38,14 @@ export async function updateSession(request: NextRequest) { const { data: { user }, - } = await supabase.auth.getUser() + } = await supabase.auth.getUser(); if ( - !user && - request.nextUrl.pathname.startsWith('/solicitudes/editar') || - !user && - request.nextUrl.pathname.startsWith('/ofertas/editar') + (!user && request.nextUrl.pathname.startsWith('/solicitudes/editar')) || + (!user && request.nextUrl.pathname.startsWith('/ofertas/editar')) ) { - url.pathname = '/auth' - return NextResponse.redirect(url) + url.pathname = '/auth'; + return NextResponse.redirect(url); } // IMPORTANT: You *must* return the supabaseResponse object as it is. If you're // creating a new response object with NextResponse.next() make sure to: