footer+responsivenes

This commit is contained in:
Timo
2026-01-01 20:18:45 +01:00
parent 7afc865a3f
commit 91313ac7d5
6 changed files with 197 additions and 3 deletions

View File

@@ -3,6 +3,28 @@ import { NextResponse } from 'next/server';
export default withAuth(
function middleware(req) {
const token = req.nextauth.token;
const path = req.nextUrl.pathname;
// Protected dashboard routes - redirect to /signup if not authenticated
const protectedRoutes = [
'/dashboard',
'/create',
'/bulk-creation',
'/analytics',
'/pricing',
'/settings',
];
// Check if current path matches any protected route
const isProtectedRoute = protectedRoutes.some(route => path.startsWith(route));
// If protected route and no token, redirect to signup
if (isProtectedRoute && !token) {
const signupUrl = new URL('/signup', req.url);
return NextResponse.redirect(signupUrl);
}
return NextResponse.next();
},
{