Changeset 603d246 in Klonkt
- Timestamp:
- 07/21/2026 01:54:46 AM (7 weeks ago)
- Branches:
- main
- Children:
- c3d12a6
- Parents:
- e685f55
- git-author:
- Robin <roboburr@…> (07/21/2026 01:54:34 AM)
- git-committer:
- Robin <roboburr@…> (07/21/2026 01:54:46 AM)
- Location:
- src
- Files:
-
- 2 edited
-
routes/admin-paid.js (modified) (2 diffs)
-
views/pages/admin-paid.ejs (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/admin-paid.js
re685f55 r603d246 18 18 const router = express.Router(); 19 19 20 // The redirect URI the owner MUST whitelist in their Patreon client. Must match 21 // exactly what paid.js sends, or Patreon shows its own error page (which we 22 // cannot skin) instead of returning the visitor to us. 23 const redirectUri = (req) => 24 (process.env.PUBLIC_BASE_URL || `${req.protocol}://${req.get('host')}`).replace(/\/+$/, '') + '/paid/callback'; 25 20 26 function gate(req, res) { 21 27 if (!premiumUnlocked()) { … … 34 40 status: PaidPatreon.ownerStatus(res.locals.site.id), 35 41 secretReady: cryptoBoxReady(), 42 redirectUri: redirectUri(req), 36 43 saved: req.query.saved === '1', 37 44 error: req.query.error || null, -
src/views/pages/admin-paid.ejs
re685f55 r603d246 23 23 <% } %> 24 24 </p> 25 26 <div style="border:1px solid var(--border,#333);border-radius:10px;padding:.9rem 1rem;margin:0 0 1.3rem;background:color-mix(in srgb,var(--accent,#6b8f71) 8%,transparent)"> 27 <p style="margin:0 0 .4rem;font-weight:600">Zet deze redirect-URI in je Patreon-client</p> 28 <p style="margin:0 0 .6rem;color:var(--ink-soft,#888);font-size:.9rem"> 29 Bij je Patreon API-client, onder <em>Redirect URIs</em>, moet exact deze regel staan. 30 Klopt hij niet, dan geeft Patreon een foutmelding in plaats van je supporters terug te sturen. 31 </p> 32 <div style="display:flex;gap:.5rem;align-items:center"> 33 <input id="pd-redirect" type="text" readonly value="<%= redirectUri %>" style="flex:1;min-width:0;font-family:monospace;font-size:.9rem"> 34 <button type="button" id="pd-copy" class="btn">Kopieer</button> 35 </div> 36 </div> 25 37 26 38 <form method="post" action="/admin/paid" style="display:flex;flex-direction:column;gap:.9rem"> … … 58 70 <p style="margin-top:1.5rem"><a href="/admin">← Terug naar Beheer</a></p> 59 71 </div> 72 73 <script> 74 (function () { 75 var field = document.getElementById('pd-redirect'); 76 var btn = document.getElementById('pd-copy'); 77 if (!field || !btn) return; 78 field.addEventListener('focus', function () { field.select(); }); 79 btn.addEventListener('click', function () { 80 field.select(); 81 var done = function () { var t = btn.textContent; btn.textContent = 'Gekopieerd'; setTimeout(function () { btn.textContent = t; }, 1400); }; 82 if (navigator.clipboard && navigator.clipboard.writeText) { navigator.clipboard.writeText(field.value).then(done, function () { try { document.execCommand('copy'); done(); } catch (e) {} }); } 83 else { try { document.execCommand('copy'); done(); } catch (e) {} } 84 }); 85 })(); 86 </script>
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)