Changeset e9229f2 in Klonkt
- Timestamp:
- 06/16/2026 06:45:02 PM (3 months ago)
- Branches:
- main
- Children:
- 1be21ba
- Parents:
- 029f047
- File:
-
- 1 edited
-
src/routes/auth.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/auth.js
r029f047 re9229f2 8 8 import { safeNext } from '../middleware/auth.js'; 9 9 import { googleConfigured, authorizeUrl, exchangeCode, fetchUserinfo } from '../config/google.js'; 10 import { premiumUnlocked } from '../services/PatreonService.js'; 11 12 // Fan-login (luisteraars inloggen met Google om te reageren) is een premium- 13 // feature: beschikbaar als Google is ingesteld ÉN de premium-laag ontgrendeld is 14 // (premium uit = vrij; aan = Patreon vereist). 15 function fanLoginReady() { 16 return googleConfigured() && premiumUnlocked(); 17 } 10 18 import { mailerConfigured, sendMail } from '../config/mailer.js'; 11 19 … … 47 55 success: req.query.success || null, 48 56 username: '', 49 googleReady: googleConfigured(),57 googleReady: fanLoginReady(), 50 58 next, 51 59 }); … … 60 68 return renderPage(req, res, 'pages/auth-login', { 61 69 pageTitle: 'Inloggen', bodyClass: 'on-special', 62 error, success: null, username: username || '', googleReady: googleConfigured(), next,70 error, success: null, username: username || '', googleReady: fanLoginReady(), next, 63 71 }); 64 72 }; … … 226 234 // Per-instance, eigen Google-client. Geeft ALTIJD rol member — nooit beheer. 227 235 router.get('/google', (req, res) => { 228 if (! googleConfigured()) {229 return res.redirect('/auth/login?error=' + encodeURIComponent(' Google-login is op deze site niet ingesteld.'));236 if (!fanLoginReady()) { 237 return res.redirect('/auth/login?error=' + encodeURIComponent('Inloggen met Google is op deze site niet beschikbaar.')); 230 238 } 231 239 const state = crypto.randomBytes(16).toString('hex'); … … 248 256 router.get('/google/callback', async (req, res) => { 249 257 const fail = (msg) => res.redirect('/auth/login?error=' + encodeURIComponent(msg)); 258 if (!fanLoginReady()) return fail('Inloggen met Google is op deze site niet beschikbaar.'); 250 259 try { 251 260 const { code, state } = req.query;
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)