- Use request.nextUrl.clone() instead of new URL() for redirects
- This preserves the /leopost basePath in redirect URLs
- Fixes 404 error when unauthenticated user visits /dashboard
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create updateSession helper for Supabase session management
- Add main middleware with protected and auth route handling
- Configure matcher to exclude static files for performance
- Session refresh on every request prevents random logouts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>