chore: deployment debugging - minimal middleware, health api, and nextjs upgrade

This commit is contained in:
2025-12-18 09:14:13 +01:00
parent 8c5d931b6e
commit f600360505
5 changed files with 244 additions and 92 deletions

View File

@@ -0,0 +1,12 @@
import { NextResponse } from 'next/server';
export async function GET() {
return NextResponse.json({
status: 'ok',
time: new Date().toISOString(),
env: {
supabaseUrl: process.env.NEXT_PUBLIC_SUPABASE_URL ? 'set' : 'missing',
supabaseAnonKey: process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY ? 'set' : 'missing'
}
});
}

View File

@@ -3,23 +3,7 @@ import { NextResponse } from 'next/server';
import type { NextRequest } from 'next/server';
export async function middleware(req: NextRequest) {
const res = NextResponse.next();
// Safety check for environment variables in production
if (!process.env.NEXT_PUBLIC_SUPABASE_URL || !process.env.NEXT_PUBLIC_SUPABASE_ANON_KEY) {
console.warn('Deployment: NEXT_PUBLIC_SUPABASE environment variables are missing.');
return res;
}
try {
const supabase = createMiddlewareClient({ req, res });
// Refresh session if expired - required for Server Components/Actions
await supabase.auth.getSession();
} catch (err) {
console.error('Middleware Error:', err);
}
return res;
return NextResponse.next();
}
export const config = {