nodebb-plugin-session-sharing 5.1.0 → 5.1.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.
- package/commitlint.config.js +24 -1
- package/library.js +3 -2
- package/package.json +1 -1
- package/static/lib/main.js +1 -1
package/commitlint.config.js
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
module.exports = {
|
|
3
|
+
module.exports = {
|
|
4
|
+
extends: ['@commitlint/config-angular'],
|
|
5
|
+
rules: {
|
|
6
|
+
'header-max-length': [1, 'always', 72],
|
|
7
|
+
'type-enum': [
|
|
8
|
+
2,
|
|
9
|
+
'always',
|
|
10
|
+
[
|
|
11
|
+
'breaking',
|
|
12
|
+
'build',
|
|
13
|
+
'chore',
|
|
14
|
+
'ci',
|
|
15
|
+
'docs',
|
|
16
|
+
'feat',
|
|
17
|
+
'fix',
|
|
18
|
+
'perf',
|
|
19
|
+
'refactor',
|
|
20
|
+
'revert',
|
|
21
|
+
'style',
|
|
22
|
+
'test',
|
|
23
|
+
],
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
};
|
package/library.js
CHANGED
|
@@ -392,7 +392,7 @@ plugin.addMiddleware = async function ({ req, res }) {
|
|
|
392
392
|
return;
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
if (editOverride && hasSession && req.originalUrl.match(/\/user\/.*\/edit
|
|
395
|
+
if (editOverride && hasSession && req.originalUrl.match(/\/user\/.*\/edit(\/\w+)?$/)) {
|
|
396
396
|
return res.redirect(editOverride.replace('%1', encodeURIComponent(req.protocol + '://' + req.get('host') + req.originalUrl)));
|
|
397
397
|
}
|
|
398
398
|
if (loginOverride && req.originalUrl.match(/\/login$/)) {
|
|
@@ -569,7 +569,7 @@ plugin.reloadSettings = async (data) => {
|
|
|
569
569
|
};
|
|
570
570
|
|
|
571
571
|
plugin.appendTemplate = async (data) => {
|
|
572
|
-
if (!data.req.session.sessionSharing || !data.req.session.sessionSharing.banned) {
|
|
572
|
+
if (!data.req.session || !data.req.session.sessionSharing || !data.req.session.sessionSharing.banned) {
|
|
573
573
|
return data;
|
|
574
574
|
}
|
|
575
575
|
|
|
@@ -591,6 +591,7 @@ plugin.saveReverseToken = async ({ req, userData: data }) => {
|
|
|
591
591
|
|
|
592
592
|
const res = req.res;
|
|
593
593
|
const userData = await user.getUserFields(data.uid, ['uid', 'username', 'picture', 'reputation', 'postcount', 'banned']);
|
|
594
|
+
userData.groups = (await groups.getUserGroups([data.uid])).pop();
|
|
594
595
|
const token = jwt.sign(userData, plugin.settings.secret);
|
|
595
596
|
|
|
596
597
|
res.cookie('nbb_token', token, {
|
package/package.json
CHANGED
package/static/lib/main.js
CHANGED