diff --git a/.replit b/.replit index 1252938..ffeb98a 100644 --- a/.replit +++ b/.replit @@ -18,10 +18,6 @@ externalPort = 80 localPort = 5555 externalPort = 3002 -[[ports]] -localPort = 32915 -externalPort = 3003 - [[ports]] localPort = 40537 externalPort = 3000 diff --git a/attached_assets/Pasted--No-config-path-provided-using-default-drizzle-config-ts-Reading-config-file-app-driz-1759388986907_1759388986907.txt b/attached_assets/Pasted--No-config-path-provided-using-default-drizzle-config-ts-Reading-config-file-app-driz-1759388986907_1759388986907.txt new file mode 100644 index 0000000..9db2e49 --- /dev/null +++ b/attached_assets/Pasted--No-config-path-provided-using-default-drizzle-config-ts-Reading-config-file-app-driz-1759388986907_1759388986907.txt @@ -0,0 +1,70 @@ + +No config path provided, using default 'drizzle.config.ts' + +Reading config file '/app/drizzle.config.ts' + +Using 'pg' driver for database querying + +[⣷] Pulling schema from database... + +[⣯] Pulling schema from database... + +[⣟] Pulling schema from database... + +[⡿] Pulling schema from database... + +[✓] Pulling schema from database... + +[i] No changes detected + +> rest-express@1.0.0 start + +> NODE_ENV=production node dist/index.js + +Warning: connect.session() MemoryStore is not + +designed for a production environment, as it will leak + +memory, and will not scale past a single process. + +🔧 Création de l'utilisateur admin par défaut... + +✅ Utilisateur admin créé avec succès + + Username: admin + + Password: admin + + ⚠️ IMPORTANT: Changez ce mot de passe immédiatement ! + +6:42:05 AM [express] serving on port 5555 + +Scheduler service started + +6:42:07 AM [express] GET /api/auth/default-password-status 200 in 60ms :: {"isDefault":true} + +6:42:12 AM [express] POST /api/auth/login 200 in 61ms :: {"id":"417b5410-1184-46d7-ac96-e85f731b0c98… + +6:42:12 AM [express] GET /api/auth/session 401 in 1ms :: {"error":"Non authentifié"} + +6:42:13 AM [express] GET /api/auth/default-password-status 304 in 74ms :: {"isDefault":true} + +6:42:21 AM [express] POST /api/auth/login 200 in 57ms :: {"id":"417b5410-1184-46d7-ac96-e85f731b0c98… + +6:42:21 AM [express] GET /api/auth/session 401 in 1ms :: {"error":"Non authentifié"} + +6:42:21 AM [express] GET /api/auth/default-password-status 304 in 54ms :: {"isDefault":true} + +6:45:00 AM [express] GET /api/auth/default-password-status 304 in 60ms :: {"isDefault":true} + +6:45:07 AM [express] POST /api/auth/login 200 in 60ms :: {"id":"417b5410-1184-46d7-ac96-e85f731b0c98… + +6:45:07 AM [express] GET /api/auth/session 401 in 1ms :: {"error":"Non authentifié"} + +6:45:07 AM [express] GET /api/auth/default-password-status 304 in 59ms :: {"isDefault":true} + +6:47:48 AM [express] POST /api/auth/login 200 in 69ms :: {"id":"417b5410-1184-46d7-ac96-e85f731b0c98… + +6:47:48 AM [express] GET /api/auth/session 401 in 1ms :: {"error":"Non authentifié"} + +6:47:48 AM [express] GET /api/auth/default-password-status 304 in 57ms :: {"isDefault":true} \ No newline at end of file diff --git a/attached_assets/image_1759388968656.png b/attached_assets/image_1759388968656.png new file mode 100644 index 0000000..37f957d Binary files /dev/null and b/attached_assets/image_1759388968656.png differ diff --git a/server/index.ts b/server/index.ts index b19736a..19731a6 100644 --- a/server/index.ts +++ b/server/index.ts @@ -24,12 +24,16 @@ app.use(express.urlencoded({ extended: false })); if (!process.env.SESSION_SECRET) { console.warn('⚠️ SESSION_SECRET non défini. Utilisation d\'une clé par défaut (NON SÉCURISÉ en production)'); } + +// Déterminer si on utilise HTTPS basé sur APP_URL +const isHttps = process.env.APP_URL?.startsWith('https://') || false; + app.use(session({ secret: process.env.SESSION_SECRET || 'your-secret-key-change-me', resave: false, saveUninitialized: false, cookie: { - secure: process.env.NODE_ENV === 'production', + secure: isHttps, httpOnly: true, sameSite: 'lax', maxAge: 7 * 24 * 60 * 60 * 1000, // 7 jours