nodebb-plugin-facebook-post 1.0.15 → 1.0.16
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 +5 -5
- package/package.json +1 -1
- package/static/lib/composer.js +2 -2
package/library.js
CHANGED
|
@@ -98,7 +98,7 @@ function isForumHosted(urlAbs) {
|
|
|
98
98
|
if (!base) return false;
|
|
99
99
|
try {
|
|
100
100
|
return new URL(urlAbs).host === new URL(base).host;
|
|
101
|
-
} catch {
|
|
101
|
+
} catch (err) {
|
|
102
102
|
return false;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
@@ -177,7 +177,7 @@ async function userIsAllowed(uid) {
|
|
|
177
177
|
// eslint-disable-next-line no-await-in-loop
|
|
178
178
|
const ok = await Groups.isMember(uid, groupName);
|
|
179
179
|
if (ok) return true;
|
|
180
|
-
} catch {
|
|
180
|
+
} catch (err) {
|
|
181
181
|
// ignore
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -366,11 +366,11 @@ Plugin.init = async function (params) {
|
|
|
366
366
|
if (!allowedGroups.length) return res.json({ allowed: false, reason: 'no_groups_configured' });
|
|
367
367
|
const ok = await userIsAllowed(uid);
|
|
368
368
|
return res.json({ allowed: ok, reason: ok ? 'ok' : 'not_in_group' });
|
|
369
|
-
} catch {
|
|
369
|
+
} catch (err) {
|
|
370
370
|
return res.json({ allowed: false, reason: 'error' });
|
|
371
371
|
}
|
|
372
372
|
});
|
|
373
|
-
} catch {
|
|
373
|
+
} catch (err) {
|
|
374
374
|
return res.json({ allowed: false });
|
|
375
375
|
}
|
|
376
376
|
});
|
|
@@ -398,7 +398,7 @@ Plugin.init = async function (params) {
|
|
|
398
398
|
await Posts.deletePostField(pid, 'fbQueueJobId');
|
|
399
399
|
await Posts.deletePostField(pid, 'fbQueuedAt');
|
|
400
400
|
return res.json({ ok: true });
|
|
401
|
-
} catch {
|
|
401
|
+
} catch (err) {
|
|
402
402
|
return res.status(500).json({ error: 'failed' });
|
|
403
403
|
}
|
|
404
404
|
});
|
package/package.json
CHANGED
package/static/lib/composer.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
});
|
|
11
11
|
if (!res.ok) return { allowed: false };
|
|
12
12
|
return await res.json();
|
|
13
|
-
} catch {
|
|
13
|
+
} catch (err) {
|
|
14
14
|
return { allowed: false };
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
if (!perm.allowed) return;
|
|
72
72
|
|
|
73
73
|
injectUI($composer);
|
|
74
|
-
} catch {
|
|
74
|
+
} catch (err) {
|
|
75
75
|
// ignore
|
|
76
76
|
}
|
|
77
77
|
});
|