mirror of
https://github.com/R0m1k3/noteflow.git
synced 2026-10-23 07:08:17 +02:00
Fix: Route force-oauth2 accessible sans authentification
This commit is contained in:
1 file changed
+4
-3
@@ -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
|
* 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 {
|
try {
|
||||||
await runQuery("INSERT OR REPLACE INTO settings (key, value) VALUES ('google_auth_type', 'oauth2')", []);
|
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'");
|
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) {
|
} catch (error) {
|
||||||
logger.error('Erreur:', error);
|
logger.error('Erreur:', error);
|
||||||
res.status(500).json({ error: error.message });
|
res.status(500).json({ error: error.message });
|
||||||
|
|||||||
Reference in new issue
Block a user