-
+ <>
+
+
+
+ {/* First row */}
+
+
}>
+
+
+
+
+
}>
+
+
+
+
+
}>
+
+
+
+
+
}>
+
+
+
+
-
-
-
-
-
-
-
-
+
+ {/* Second row */}
+
-
- {/* Second row */}
-
-
-
+
+ >
);
}
diff --git a/components/home-logout-check.tsx b/components/home-logout-check.tsx
new file mode 100644
index 0000000..59c2897
--- /dev/null
+++ b/components/home-logout-check.tsx
@@ -0,0 +1,28 @@
+"use client";
+
+import { useEffect } from "react";
+import { useRouter } from "next/navigation";
+
+/**
+ * Client component to handle logout state check
+ * This checks sessionStorage and cookies for logout flags
+ * and redirects if logout is in progress
+ */
+export function HomeLogoutCheck() {
+ const router = useRouter();
+
+ useEffect(() => {
+ // Check if logout is in progress - if so, redirect immediately
+ const justLoggedOut = sessionStorage.getItem('just_logged_out') === 'true';
+ const logoutCookie = document.cookie.split(';').some(c => c.trim().startsWith('logout_in_progress=true'));
+
+ if (justLoggedOut || logoutCookie) {
+ // Clear the flags and redirect
+ sessionStorage.removeItem('just_logged_out');
+ document.cookie = 'logout_in_progress=; path=/; expires=Thu, 01 Jan 1970 00:00:00 UTC';
+ router.push('/signin?logout=true');
+ }
+ }, [router]);
+
+ return null;
+}
diff --git a/lib/services/caldav-sync.ts b/lib/services/caldav-sync.ts
index a82960b..3f3a8b7 100644
--- a/lib/services/caldav-sync.ts
+++ b/lib/services/caldav-sync.ts
@@ -1,3 +1,4 @@
+// @ts-ignore - webdav package types may not be available
import { createClient, WebDAVClient } from 'webdav';
import { prisma } from '@/lib/prisma';
import { logger } from '@/lib/logger';
@@ -54,12 +55,12 @@ export async function discoverInfomaniakCalendars(
logger.debug('[CALDAV] Found items in root directory', {
count: items.length,
- items: items.map(item => ({ filename: item.filename, type: item.type, basename: item.basename }))
+ items: items.map((item: any) => ({ filename: item.filename, type: item.type, basename: item.basename }))
});
const calendars: CalDAVCalendar[] = [];
- for (const item of items) {
+ for (const item of items as any[]) {
// Skip non-directories, root, and special directories like /principals
if (item.type !== 'directory' || item.filename === '/' || item.filename === '/principals') {
logger.debug('[CALDAV] Skipping item', { filename: item.filename, type: item.type });
diff --git a/next.config.mjs b/next.config.mjs
index 5c7e92b..5165e91 100644
--- a/next.config.mjs
+++ b/next.config.mjs
@@ -1,13 +1,28 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
eslint: {
- ignoreDuringBuilds: true,
+ ignoreDuringBuilds: false, // ✅ Réactivé - corriger les erreurs avant build
+ dirs: ['app', 'components', 'lib'], // Limiter aux dossiers pertinents
},
typescript: {
- ignoreBuildErrors: true,
+ ignoreBuildErrors: false, // ✅ Réactivé - corriger les erreurs avant build
},
images: {
- unoptimized: true,
+ unoptimized: false, // ✅ Activé l'optimisation d'images
+ formats: ['image/avif', 'image/webp'],
+ deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
+ imageSizes: [16, 32, 48, 64, 96, 128, 256, 384],
+ remotePatterns: [
+ {
+ protocol: 'https',
+ hostname: '**',
+ },
+ {
+ protocol: 'http',
+ hostname: 'localhost',
+ port: '9000', // MinIO local
+ },
+ ],
},
experimental: {
webpackBuildWorker: true,
@@ -22,9 +37,46 @@ const nextConfig = {
{
source: '/:path*',
headers: [
+ {
+ key: 'X-DNS-Prefetch-Control',
+ value: 'on'
+ },
+ {
+ key: 'Strict-Transport-Security',
+ value: 'max-age=63072000; includeSubDomains; preload'
+ },
+ {
+ key: 'X-Frame-Options',
+ value: 'SAMEORIGIN'
+ },
+ {
+ key: 'X-Content-Type-Options',
+ value: 'nosniff'
+ },
+ {
+ key: 'X-XSS-Protection',
+ value: '1; mode=block'
+ },
+ {
+ key: 'Referrer-Policy',
+ value: 'origin-when-cross-origin'
+ },
+ {
+ key: 'Permissions-Policy',
+ value: 'camera=(), microphone=(), geolocation=()'
+ },
{
key: 'Content-Security-Policy',
- value: "frame-ancestors 'self' https://espace.slm-lab.net https://connect.slm-lab.net"
+ value: [
+ "default-src 'self'",
+ "script-src 'self' 'unsafe-eval' 'unsafe-inline'", // ⚠️ À restreindre davantage si possible
+ "style-src 'self' 'unsafe-inline'",
+ "img-src 'self' data: https: http://localhost:9000",
+ "font-src 'self' data:",
+ "connect-src 'self' https://*.slm-lab.net https://*.microsoft.com https://*.microsoftonline.com wss://*.slm-lab.net",
+ "frame-src 'self' https://*.slm-lab.net",
+ "frame-ancestors 'self' https://espace.slm-lab.net https://connect.slm-lab.net",
+ ].join('; ')
}
]
}