Changeset 2248cd2 in Klonkt for src/routes
- Timestamp:
- 06/16/2026 10:28:54 PM (3 months ago)
- Branches:
- main
- Children:
- e2a8e31
- Parents:
- 221a209
- File:
-
- 1 edited
-
src/routes/admin-settings.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-settings.js
r221a209 r2248cd2 23 23 import { getTenancy, setTenancy, getSetting, setSetting } from '../services/SettingsService.js'; 24 24 import { entitlementStatus, premiumUnlocked } from '../services/PatreonService.js'; 25 import { googleConfigured, redirectUri, currentClientId, clientSecretSet } from '../config/google.js'; 25 26 26 27 const router = express.Router(); … … 76 77 hubHeroOverlay: clampOverlay(getSetting('hub_hero_overlay')), 77 78 premium: entitlementStatus(), 79 google: { 80 configured: googleConfigured(), 81 redirectUri: redirectUri(), 82 clientId: currentClientId(), 83 secretSet: clientSecretSet(), 84 }, 78 85 success: req.query.success || null, 79 86 error: req.query.error || null, … … 129 136 }); 130 137 138 // Google-login (luisteraars) configureren — Client ID + Secret in app_settings. 139 // De redirect-URI leiden we af van PUBLIC_BASE_URL (zie config/google.js). 140 router.post('/google', requireGod, (req, res) => { 141 if (req.body.clear === '1') { 142 setSetting('google_client_id', ''); 143 setSetting('google_client_secret', ''); 144 return res.redirect('/admin/settings?success=' + encodeURIComponent('Google-login losgekoppeld')); 145 } 146 setSetting('google_client_id', (req.body.google_client_id || '').toString().trim()); 147 // Secret alleen overschrijven als er een nieuwe waarde is ingevoerd (leeg = laat staan). 148 const secret = (req.body.google_client_secret || '').toString().trim(); 149 if (secret) setSetting('google_client_secret', secret); 150 res.redirect('/admin/settings?success=' + encodeURIComponent('Google-login opgeslagen')); 151 }); 152 131 153 export default router;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)