nodebb-plugin-facebook-post 1.0.2 → 1.0.4

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.
Files changed (2) hide show
  1. package/library.js +2 -2
  2. package/package.json +5 -2
package/library.js CHANGED
@@ -278,8 +278,8 @@ async function enqueueJob(job) {
278
278
 
279
279
  async function ensureAdmin(req) {
280
280
  const User = require.main.require('./src/user');
281
- const uid = req.uid;
282
- if (!uid) return false;
281
+ const uid = req.uid || (req.user && (req.user.uid || req.user.uid === 0 ? req.user.uid : null)) || (req.session && req.session.uid);
282
+ if (uid === undefined || uid === null) return false;
283
283
 
284
284
  try { if (await User.isAdministrator(uid)) return true; } catch {}
285
285
  try { if (await User.isAdminOrGlobalMod(uid)) return true; } catch {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-facebook-post",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Queue-based worker to auto-post new NodeBB topics to a fixed Facebook Page and optionally Instagram (images only).",
5
5
  "main": "library.js",
6
6
  "dependencies": {
@@ -11,5 +11,8 @@
11
11
  "engines": {
12
12
  "node": ">=18"
13
13
  },
14
- "license": "MIT"
14
+ "license": "MIT",
15
+ "nbbpm": {
16
+ "compatibility": "^4.0.0"
17
+ }
15
18
  }