Changeset c3d12a6 in Klonkt for src/routes
- Timestamp:
- 07/21/2026 02:07:18 AM (7 weeks ago)
- Branches:
- main
- Children:
- 9019a3e
- Parents:
- 603d246
- git-author:
- Robin <roboburr@…> (07/21/2026 02:07:07 AM)
- git-committer:
- Robin <roboburr@…> (07/21/2026 02:07:18 AM)
- Location:
- src/routes
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-paid.js
r603d246 rc3d12a6 60 60 accessToken: (b.access_token || '').trim() || undefined, 61 61 refreshToken: (b.refresh_token || '').trim() || undefined, 62 // Empty clears it (null), a value sets it. Unlike secrets, this is not 63 // sensitive and there's a clear "remove the link" intent. 64 patreonUrl: (b.patreon_url || '').trim() || null, 62 65 defaultMinCents: Number.isFinite(cents) ? cents : undefined, 63 66 }); -
src/routes/paid.js
r603d246 rc3d12a6 54 54 const payload = verifyBlob(String(req.query.state || '')); 55 55 if (!payload || payload.purpose !== 'patron' || payload.siteId !== r.site.id) { 56 return res.status(400).send('Ongeldige of verlopen aanvraag. Probeer opnieuw vanaf de post.'); 56 return renderPage(req, res, 'pages/paid-result', { 57 pageTitle: 'Ontgrendelen', bodyClass: 'on-special', ok: false, reason: 'expired', 58 }); 57 59 } 60 const patronUrl = PaidPatreon.patreonUrl(r.site.id); 58 61 const code = String(req.query.code || ''); 59 62 if (req.query.error || !code) { 60 return renderPage(req, res, 'pages/paid-result', { pageTitle: 'Ontgrendelen', bodyClass: 'on-special', ok: false, reason: 'declined', postSlug: payload.post });63 return renderPage(req, res, 'pages/paid-result', { pageTitle: 'Ontgrendelen', bodyClass: 'on-special', ok: false, reason: 'declined', postSlug: payload.post, patronUrl }); 61 64 } 62 65 const membership = await PaidPatreon.verifyPatron(r.site.id, code, baseUrl(req) + '/paid/callback').catch(() => null); … … 66 69 return renderPage(req, res, 'pages/paid-result', { 67 70 pageTitle: 'Ontgrendelen', bodyClass: 'on-special', ok: false, 68 reason: active ? 'tier' : 'notpatron', neededCents: payload.cents, haveCents: cents, postSlug: payload.post, 71 reason: active ? 'tier' : 'notpatron', neededCents: payload.cents, haveCents: cents, postSlug: payload.post, patronUrl, 69 72 }); 70 73 } -
src/routes/posts.js
r603d246 rc3d12a6 21 21 import ActivityPubService from '../services/ActivityPubService.js'; 22 22 import { premiumUnlocked } from '../services/PatreonService.js'; 23 import { defaultMinCents as paidDefaultMinCents } from '../services/PaidPatreonService.js';23 import { defaultMinCents as paidDefaultMinCents, patreonUrl as paidPatronUrl } from '../services/PaidPatreonService.js'; 24 24 import MusicMeta from '../services/MusicMeta.js'; 25 25 … … 1247 1247 pgCents: post.paid_min_cents || paidDefaultMinCents(site.id), 1248 1248 pgSlug: post.slug, 1249 pgPatronUrl: paidPatronUrl(site.id), 1249 1250 newerPost, 1250 1251 olderPost,
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)