test fix
This commit is contained in:
@@ -15,6 +15,17 @@ export default async function middleware(req: NextRequest) {
|
||||
const isAuthRoute = authRoutes.includes(path);
|
||||
|
||||
const cookie = req.cookies.get('session')?.value;
|
||||
|
||||
// Debug logging for production
|
||||
if (!cookie && (isProtectedRoute || isAuthRoute)) {
|
||||
console.log(`No session cookie found for ${path}, headers:`, {
|
||||
host: req.headers.get('host'),
|
||||
'x-forwarded-proto': req.headers.get('x-forwarded-proto'),
|
||||
'x-forwarded-host': req.headers.get('x-forwarded-host'),
|
||||
cookies: req.headers.get('cookie')
|
||||
});
|
||||
}
|
||||
|
||||
const session = await decrypt(cookie);
|
||||
|
||||
// Redirect to login if accessing protected route without session
|
||||
|
||||
Reference in New Issue
Block a user