mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-23 15:18:16 +02:00
Fix: Ajout d'une route de debug pour forcer OAuth2
Ajout de la route GET /api/calendar/force-oauth2 pour forcer le changement du type d'authentification vers OAuth2 dans la BDD. Cette route permet de contourner un problème où le bouton "Enregistrer" ne sauvegarde pas correctement google_auth_type.
This commit is contained in:
2 files changed
+59
No files matched your search
@@ -113,6 +113,21 @@ async function getCalendarClient(userId = null) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* GET /api/calendar/force-oauth2 (TEMPORAIRE - DEBUG)
|
||||
* Forcer le type d'authentification à OAuth2
|
||||
*/
|
||||
router.get('/force-oauth2', requireAdmin, 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 });
|
||||
} catch (error) {
|
||||
logger.error('Erreur:', error);
|
||||
res.status(500).json({ error: error.message });
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* GET /api/calendar/auth-url
|
||||
* Générer l'URL d'authentification OAuth
|
||||
|
||||
Reference in new issue
Block a user