From 5ebaa7213637ab2c9116eedc9c276e9c414c9b41 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 12 Nov 2025 14:06:02 +0000 Subject: [PATCH] Fix: Route force-oauth2 accessible sans authentification --- routes/calendar.routes.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/routes/calendar.routes.js b/routes/calendar.routes.js index 5cecd0d..931e5c9 100644 --- a/routes/calendar.routes.js +++ b/routes/calendar.routes.js @@ -114,14 +114,15 @@ async function getCalendarClient(userId = null) { } /** - * GET /api/calendar/force-oauth2 (TEMPORAIRE - DEBUG) + * GET /api/calendar/force-oauth2 (TEMPORAIRE - DEBUG - SANS AUTH) * Forcer le type d'authentification à OAuth2 + * ATTENTION : Route sans authentification, à supprimer après utilisation */ -router.get('/force-oauth2', requireAdmin, async (req, res) => { +router.get('/force-oauth2', async (req, res) => { try { await runQuery("INSERT OR REPLACE INTO settings (key, value) VALUES ('google_auth_type', 'oauth2')", []); const check = await getOne("SELECT value FROM settings WHERE key = 'google_auth_type'"); - res.json({ success: true, auth_type: check?.value }); + res.json({ success: true, auth_type: check?.value, message: 'Type changé vers OAuth2. Rechargez la page d\'administration.' }); } catch (error) { logger.error('Erreur:', error); res.status(500).json({ error: error.message });