nodebb-plugin-equipment-calendar 0.2.9 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/library.js CHANGED
@@ -311,8 +311,8 @@ plugin.init = async function (params) {
311
311
 
312
312
  // Admin (ACP) routes
313
313
  if (mid && mid.admin) {
314
- router.get('/admin/plugins/equipment-calendar', mid.admin.buildHeader, renderAdminPage);
315
- router.get('/api/admin/plugins/equipment-calendar', renderAdminPage);
314
+ router.get('/admin/plugins/equipment-calendar', middleware.applyCSRF, mid.admin.buildHeader, renderAdminPage);
315
+ router.get('/api/admin/plugins/equipment-calendar', middleware.applyCSRF, renderAdminPage);
316
316
  router.post('/admin/plugins/equipment-calendar/save', middleware.applyCSRF, handleAdminSave);
317
317
  }
318
318
 
@@ -393,8 +393,8 @@ plugin.addAdminNavigation = async function (header) {
393
393
  // --- Admin page routes (ACP) ---
394
394
  plugin.addAdminRoutes = async function (params) {
395
395
  const { router, middleware: mid } = params;
396
- router.get('/admin/plugins/equipment-calendar', mid.admin.buildHeader, renderAdminPage);
397
- router.get('/api/admin/plugins/equipment-calendar', renderAdminPage);
396
+ router.get('/admin/plugins/equipment-calendar', middleware.applyCSRF, mid.admin.buildHeader, renderAdminPage);
397
+ router.get('/api/admin/plugins/equipment-calendar', middleware.applyCSRF, renderAdminPage);
398
398
  };
399
399
 
400
400
  async function renderAdminPage(req, res) {
@@ -488,7 +488,6 @@ async function renderCalendarPage(req, res) {
488
488
  eventsB64: Buffer.from(JSON.stringify(events), 'utf8').toString('base64'),
489
489
  blocksB64: Buffer.from(JSON.stringify(blocks), 'utf8').toString('base64'),
490
490
  itemsB64: Buffer.from(JSON.stringify(items.map(i => ({ id: i.id, name: i.name, location: i.location }))), 'utf8').toString('base64'),
491
- csrf: req.csrfToken,
492
491
  });
493
492
  }
494
493
 
@@ -538,7 +537,6 @@ async function renderApprovalsPage(req, res) {
538
537
  title: 'Validation des réservations',
539
538
  rows,
540
539
  hasRows: Array.isArray(rows) && rows.length > 0,
541
- csrf: req.csrfToken,
542
540
  });
543
541
  }
544
542
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-equipment-calendar",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "description": "Equipment reservation calendar for NodeBB (FullCalendar, approvals, HelloAsso payments)",
5
5
  "main": "library.js",
6
6
  "scripts": {
package/plugin.json CHANGED
@@ -26,6 +26,6 @@
26
26
  "scripts": [
27
27
  "public/js/client.js"
28
28
  ],
29
- "version": "0.2.1",
29
+ "version": "0.2.2",
30
30
  "minver": "4.7.1"
31
31
  }
@@ -2,7 +2,7 @@
2
2
  <h1>Equipment Calendar</h1>
3
3
 
4
4
  <form method="post" action="/admin/plugins/equipment-calendar/save" class="mb-3">
5
- <input type="hidden" name="_csrf" value="{csrf}">
5
+ <input type="hidden" name="_csrf" value="{config.csrf_token}">
6
6
 
7
7
  <div class="alert alert-warning">
8
8
  Le champ "Matériel" doit être un JSON valide (array). Exemple :
@@ -24,7 +24,7 @@
24
24
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Fermer"></button>
25
25
  </div>
26
26
  <div class="modal-body">
27
- <input type="hidden" name="_csrf" value="{csrf}">
27
+ <input type="hidden" name="_csrf" value="{config.csrf_token}">
28
28
  <input type="hidden" name="start" value="">
29
29
  <input type="hidden" name="end" value="">
30
30