diff --git a/server/middleware.ts b/server/middleware.ts index a78cd47..ae4e880 100644 --- a/server/middleware.ts +++ b/server/middleware.ts @@ -68,8 +68,9 @@ export async function middleware(request: NextRequest) { password: dummyPassword }); if (signUpError) { - console.error(signInError); - throw(signUpError); + console.error('Sign-in error:', signInError); + console.error('Sign-up error:', signUpError); + throw new Error('Failed to handle local development auth bypass.'); } } return response @@ -79,7 +80,7 @@ export async function middleware(request: NextRequest) { } = await supabase.auth.getUser(); const allowedPathsRegex = new RegExp(`^(/|/login|/auth/callback|/docs/.+)$`); - if ((!user || user.email === 'demo@draft.test') && !allowedPathsRegex.test(request.nextUrl.pathname)) { + if (!user && !allowedPathsRegex.test(request.nextUrl.pathname)) { const url = request.nextUrl.clone(); url.pathname = `/404`; return NextResponse.rewrite(url);