From 0d903315e885d716b6c5fe76ff480d50b45a2088 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 13 Aug 2025 21:27:01 +0000 Subject: [PATCH 1/3] Remove duplicate application title from the main view Remove the redundant 'LogiFlow' heading from the main application layout, retaining only the sidebar instance. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/rFhUGKT --- client/src/components/Layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/components/Layout.tsx b/client/src/components/Layout.tsx index 5713485..acdbd3e 100644 --- a/client/src/components/Layout.tsx +++ b/client/src/components/Layout.tsx @@ -90,7 +90,7 @@ export default function Layout({ children }: LayoutProps) { )} -

LogiFlow

+ {/* Store selector for admin - responsive */} From f42379b330aeb4dcd566ad627d09b9c7b3159eeb Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 13 Aug 2025 21:28:29 +0000 Subject: [PATCH 2/3] Automatically redirect unauthenticated users to the login page Implement automatic redirection to the authentication page for unauthenticated users, both client-side and for API 401 responses, to prevent access to protected routes or data. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/jxMXcbq --- client/src/components/RouterProduction.tsx | 14 ++++++++++++++ client/src/lib/queryClient.ts | 11 ++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/client/src/components/RouterProduction.tsx b/client/src/components/RouterProduction.tsx index 53f7a54..6a7506f 100644 --- a/client/src/components/RouterProduction.tsx +++ b/client/src/components/RouterProduction.tsx @@ -54,6 +54,20 @@ function RouterProduction() { } if (!isAuthenticated) { + // Redirection automatique vers la page d'authentification + if (typeof window !== 'undefined' && window.location.pathname !== '/auth') { + console.log('🔄 User not authenticated, redirecting to auth page'); + window.location.href = '/auth'; + return ( +
+
+
+

Redirection...

+
+
+ ); + } + return ( diff --git a/client/src/lib/queryClient.ts b/client/src/lib/queryClient.ts index fa5743f..8befad5 100644 --- a/client/src/lib/queryClient.ts +++ b/client/src/lib/queryClient.ts @@ -54,6 +54,11 @@ export const getQueryFn: (options: { }); if (unauthorizedBehavior === "returnNull" && res.status === 401) { + // Redirection automatique vers la page d'authentification si 401 + if (typeof window !== 'undefined' && window.location.pathname !== '/auth') { + console.log('🔄 API 401 - Redirecting to auth page'); + window.location.href = '/auth'; + } return null; } @@ -72,8 +77,12 @@ export const queryClient = new QueryClient({ staleTime: 30 * 1000, // 30 secondes de cache pour de meilleures performances gcTime: 10 * 60 * 1000, // 10 minutes retry: (failureCount, error: any) => { - // Ne pas retry les erreurs d'authentification + // Ne pas retry les erreurs d'authentification et rediriger if (error?.message?.includes('401') || error?.message?.includes('Unauthorized')) { + if (typeof window !== 'undefined' && window.location.pathname !== '/auth') { + console.log('🔄 Query 401 - Redirecting to auth page'); + window.location.href = '/auth'; + } return false; } return failureCount < 2; From eaf2de69600b06ee83bdc1050a26dfbe0af2525c Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 13 Aug 2025 21:30:20 +0000 Subject: [PATCH 3/3] Reorganize navigation by moving suppliers and stores to administration Refactors the sidebar navigation by moving "Fournisseurs" and "Magasins" to the "Administration" category and removing the "Gestion" category. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 7c468936-2a88-4686-ac0a-84921a45222d Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/7c468936-2a88-4686-ac0a-84921a45222d/St2dwA2 --- client/src/components/Sidebar.tsx | 56 +++++-------------------------- replit.md | 14 ++++++++ 2 files changed, 22 insertions(+), 48 deletions(-) diff --git a/client/src/components/Sidebar.tsx b/client/src/components/Sidebar.tsx index 516881e..99069b6 100644 --- a/client/src/components/Sidebar.tsx +++ b/client/src/components/Sidebar.tsx @@ -125,7 +125,13 @@ export default function Sidebar() { }, ]; - const managementItems = [ + const adminItems = [ + { + path: "/users", + label: "Utilisateurs", + icon: UserCog, + roles: ["admin"] + }, { path: "/suppliers", label: "Fournisseurs", @@ -138,15 +144,6 @@ export default function Sidebar() { icon: Users, roles: ["admin"] }, - ]; - - const adminItems = [ - { - path: "/users", - label: "Utilisateurs", - icon: UserCog, - roles: ["admin"] - }, { path: "/utilities", label: "Utilitaires", @@ -377,44 +374,7 @@ export default function Sidebar() { })} - {/* Management Section */} - {managementItems.some(item => hasPermission(item.roles)) && ( - <> - {!sidebarCollapsed && ( -
-

- Gestion -

-
- )} - {sidebarCollapsed &&
} -
- {managementItems.map((item) => { - if (!hasPermission(item.roles)) return null; - - const Icon = item.icon; - const active = isActive(item.path); - - return ( - -
console.log(`Navigating to management: ${item.path}`)} - > - - {!sidebarCollapsed && item.label} -
- - ); - })} -
- - )} + {/* Administration Section */} diff --git a/replit.md b/replit.md index 3f717b6..2ca26ef 100644 --- a/replit.md +++ b/replit.md @@ -19,6 +19,20 @@ La plateforme fournit une gestion robuste des flux de travail de livraison avec ## Recent Changes +### 2025-08-13 - Interface épurée + redirection automatique + réorganisation navigation +✅ **Redirection automatique vers authentification** : +- RouterProduction redirige immédiatement si utilisateur non connecté +- Query client gère les erreurs 401 avec redirection automatique +- Gestion centralisée des sessions expirées pour meilleure UX +- Plus de pages d'erreur, redirection transparente vers /auth + +✅ **Interface épurée et navigation optimisée** : +- Titre LogiFlow supprimé du header principal (évite redondance) +- Seul titre dans la sidebar conservé pour navigation centralisée +- Fournisseurs et Magasins déplacés dans Administration +- Catégorie "Gestion" supprimée (consolidation menu) +- Interface plus propre et logique + ### 2025-08-13 - Module de sauvegarde PostgreSQL implémenté + correction ESM ✅ **Module de sauvegarde PostgreSQL complet** : - **Interface BackupManager** : Affichage des sauvegardes avec détails (taille, tables, statut)