Changeset d48ea02 in Klonkt
- Timestamp:
- 07/21/2026 01:38:37 AM (7 weeks ago)
- Branches:
- main
- Children:
- e685f55
- Parents:
- 6cbd014
- git-author:
- Robin <roboburr@…> (07/21/2026 01:38:23 AM)
- git-committer:
- Robin <roboburr@…> (07/21/2026 01:38:37 AM)
- File:
-
- 1 edited
-
src/routes/posts.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/posts.js
r6cbd014 rd48ea02 1232 1232 } 1233 1233 1234 // Paid gate (klonkt-demo-aki): a paid post shows only a teaser to anyone who 1235 // is not the owner/editor. Checked BEFORE the fan gate: a post that is both 1236 // fan_only and paid unlocks with a passkey, not with a Klonkt-login, so the 1237 // paid gate wins (otherwise anonymous visitors land on the login gate and 1238 // never see the unlock button). 1239 const canEditThis = req.session?.user && PermissionsService.canEditPost(req.session.user, post, site); 1240 if (post.paid && !canEditThis) { 1241 const { newerPost, olderPost } = postNeighbors(site, post, res.locals.tenancy === 'hub'); 1242 return renderPage(req, res, 'pages/paid-gate', { 1243 pageTitle: post.title || 'Voor supporters', 1244 bodyClass: 'on-special', 1245 pgTitle: post.title || '', 1246 pgTeaser: paidTeaser(post), 1247 pgCents: post.paid_min_cents || paidDefaultMinCents(site.id), 1248 pgSlug: post.slug, 1249 newerPost, 1250 olderPost, 1251 }); 1252 } 1253 1234 1254 // Fan-only preview (premium #3): full content only for logged-in fans. 1235 1255 // Anonymous visitors get a clean login gate instead of the content (the title/ … … 1244 1264 fgTitle: post.title || '', 1245 1265 fgNext: (res.locals.siteUrlBase || '') + '/' + post.slug, 1246 newerPost,1247 olderPost,1248 });1249 }1250 1251 // Paid gate (klonkt-demo-aki): a paid post shows only a teaser to anyone who1252 // is not the owner/editor. The passkey unlock arrives in slices 3-4; for now1253 // the owner previews the full post, everyone else sees the teaser + notice.1254 const canEditThis = req.session?.user && PermissionsService.canEditPost(req.session.user, post, site);1255 if (post.paid && !canEditThis) {1256 const { newerPost, olderPost } = postNeighbors(site, post, res.locals.tenancy === 'hub');1257 return renderPage(req, res, 'pages/paid-gate', {1258 pageTitle: post.title || 'Voor supporters',1259 bodyClass: 'on-special',1260 pgTitle: post.title || '',1261 pgTeaser: paidTeaser(post),1262 pgCents: post.paid_min_cents || paidDefaultMinCents(site.id),1263 pgSlug: post.slug,1264 1266 newerPost, 1265 1267 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)