diff --git a/client/coral-admin/src/routes/Moderation/components/Comment.css b/client/coral-admin/src/routes/Moderation/components/Comment.css
index 119688b73..b0d989c54 100644
--- a/client/coral-admin/src/routes/Moderation/components/Comment.css
+++ b/client/coral-admin/src/routes/Moderation/components/Comment.css
@@ -143,7 +143,6 @@
i {
font-size: 12px;
- top: 2px;
position: relative;
}
}
diff --git a/client/coral-ui/components/Label.css b/client/coral-ui/components/Label.css
index 5e7f656ee..18723fa2f 100644
--- a/client/coral-ui/components/Label.css
+++ b/client/coral-ui/components/Label.css
@@ -10,6 +10,7 @@
line-height: 22px;
min-width: 80px;
text-align: center;
+ vertical-align: text-top;
}
.icon {
diff --git a/package.json b/package.json
index c5f7667a4..435815220 100644
--- a/package.json
+++ b/package.json
@@ -117,9 +117,9 @@
"inquirer": "^3.2.2",
"inquirer-autocomplete-prompt": "^0.12.1",
"ioredis": "3.1.4",
- "joi": "^10.6.0",
+ "joi": "^13.0.0",
"json-loader": "^0.5.7",
- "jsonwebtoken": "^7.4.3",
+ "jsonwebtoken": "^8.0.0",
"jwt-decode": "^2.2.0",
"keymaster": "^1.6.2",
"kue": "0.11.6",
diff --git a/plugins/talk-plugin-akismet/client/components/SpamDetail.js b/plugins/talk-plugin-akismet/client/components/SpamDetail.js
index dafdb5a86..951622e34 100644
--- a/plugins/talk-plugin-akismet/client/components/SpamDetail.js
+++ b/plugins/talk-plugin-akismet/client/components/SpamDetail.js
@@ -5,7 +5,7 @@ import { t } from 'plugin-api/beta/client/services';
const SpamLabel = () => (
diff --git a/plugins/talk-plugin-akismet/client/components/SpamLabel.js b/plugins/talk-plugin-akismet/client/components/SpamLabel.js
index c2033ff39..17c9b53ef 100644
--- a/plugins/talk-plugin-akismet/client/components/SpamLabel.js
+++ b/plugins/talk-plugin-akismet/client/components/SpamLabel.js
@@ -3,7 +3,7 @@ import { FlagLabel } from 'plugin-api/beta/client/components/ui';
import { t } from 'plugin-api/beta/client/services';
const SpamLabel = () => (
- {t('talk-plugin-akismet.spam')}
+ {t('talk-plugin-akismet.spam')}
);
export default SpamLabel;
diff --git a/plugins/talk-plugin-akismet/client/containers/SpamCommentDetail.js b/plugins/talk-plugin-akismet/client/containers/SpamCommentDetail.js
index a133be062..a49fd89ca 100644
--- a/plugins/talk-plugin-akismet/client/containers/SpamCommentDetail.js
+++ b/plugins/talk-plugin-akismet/client/containers/SpamCommentDetail.js
@@ -5,7 +5,7 @@ import { isSpam } from '../utils';
const enhance = compose(
excludeIf(
- ({ comment: { spam, actions } }) => spam === null || isSpam(actions)
+ ({ comment: { spam, actions } }) => spam === null || !isSpam(actions)
)
);
diff --git a/plugins/talk-plugin-akismet/client/containers/SpamCommentFlagDetail.js b/plugins/talk-plugin-akismet/client/containers/SpamCommentFlagDetail.js
deleted file mode 100644
index a49fd89ca..000000000
--- a/plugins/talk-plugin-akismet/client/containers/SpamCommentFlagDetail.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import { compose } from 'react-apollo';
-import { excludeIf } from 'plugin-api/beta/client/hocs';
-import SpamDetail from './SpamDetail';
-import { isSpam } from '../utils';
-
-const enhance = compose(
- excludeIf(
- ({ comment: { spam, actions } }) => spam === null || !isSpam(actions)
- )
-);
-
-export default enhance(SpamDetail);
diff --git a/plugins/talk-plugin-akismet/client/index.js b/plugins/talk-plugin-akismet/client/index.js
index 0eca7ab85..7170e14fb 100644
--- a/plugins/talk-plugin-akismet/client/index.js
+++ b/plugins/talk-plugin-akismet/client/index.js
@@ -2,7 +2,6 @@ import translations from './translations.yml';
import CheckSpamHook from './containers/CheckSpamHook';
import SpamLabel from './containers/SpamLabel';
import SpamCommentDetail from './containers/SpamCommentDetail';
-import SpamCommentFlagDetail from './containers/SpamCommentFlagDetail';
export default {
translations,
@@ -10,6 +9,5 @@ export default {
commentInputDetailArea: [CheckSpamHook],
adminCommentLabels: [SpamLabel],
adminCommentMoreDetails: [SpamCommentDetail],
- adminCommentMoreFlagDetails: [SpamCommentFlagDetail],
},
};
diff --git a/plugins/talk-plugin-toxic-comments/client/components/ToxicDetail.js b/plugins/talk-plugin-toxic-comments/client/components/ToxicDetail.js
index 6a278b63b..9530188f2 100644
--- a/plugins/talk-plugin-toxic-comments/client/components/ToxicDetail.js
+++ b/plugins/talk-plugin-toxic-comments/client/components/ToxicDetail.js
@@ -29,7 +29,7 @@ const getInfo = (toxicity, actions) => {
const ToxicLabel = ({ comment: { actions, toxicity } }) => (
diff --git a/plugins/talk-plugin-toxic-comments/client/components/ToxicLabel.js b/plugins/talk-plugin-toxic-comments/client/components/ToxicLabel.js
index cb9bca87e..d0f5bbe29 100644
--- a/plugins/talk-plugin-toxic-comments/client/components/ToxicLabel.js
+++ b/plugins/talk-plugin-toxic-comments/client/components/ToxicLabel.js
@@ -1,6 +1,6 @@
import React from 'react';
import { FlagLabel } from 'plugin-api/beta/client/components/ui';
-const ToxicLabel = () => Toxic;
+const ToxicLabel = () => Toxic;
export default ToxicLabel;
diff --git a/services/jwt.js b/services/jwt.js
index 67e45a3ab..356adbb62 100644
--- a/services/jwt.js
+++ b/services/jwt.js
@@ -1,5 +1,5 @@
const jwt = require('jsonwebtoken');
-const uniq = require('lodash/uniq');
+const { merge, uniq, omitBy, isUndefined } = require('lodash');
/**
* MultiSecret will take many secrets and provide a unified interface for
@@ -22,7 +22,10 @@ class MultiSecret {
* Sign will sign with the first secret.
*/
sign(payload, options) {
- return this.secrets[0].sign(payload, options);
+ return this.secrets[0].sign(
+ omitBy(payload, isUndefined),
+ omitBy(options, isUndefined)
+ );
}
/**
@@ -78,10 +81,13 @@ class Secret {
return jwt.sign(
payload,
this.signingKey,
- Object.assign({}, options, {
- keyid: this.kid,
- algorithm: this.algorithm,
- })
+ omitBy(
+ merge({}, options, {
+ keyid: this.kid,
+ algorithm: this.algorithm,
+ }),
+ isUndefined
+ )
);
}
diff --git a/services/tokens.js b/services/tokens.js
index 636465262..2f62af61f 100644
--- a/services/tokens.js
+++ b/services/tokens.js
@@ -27,7 +27,9 @@ module.exports = class TokenService {
pat: true,
};
- set(payload, JWT_USER_ID_CLAIM, userID);
+ if (userID) {
+ set(payload, JWT_USER_ID_CLAIM, userID);
+ }
// Sign the payload.
const jwt = JWT_SECRET.sign(payload, {});
diff --git a/yarn.lock b/yarn.lock
index 427876288..bc59a3be3 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -4013,6 +4013,10 @@ hoek@4.x.x:
version "4.2.0"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-4.2.0.tgz#72d9d0754f7fe25ca2d01ad8f8f9a9449a89526d"
+hoek@5.x.x:
+ version "5.0.3"
+ resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.3.tgz#b71d40d943d0a95da01956b547f83c4a5b4a34ac"
+
hoist-non-react-statics@^1.0.0, hoist-non-react-statics@^1.0.3, hoist-non-react-statics@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
@@ -4608,9 +4612,11 @@ isemail@1.x.x:
version "1.2.0"
resolved "https://registry.yarnpkg.com/isemail/-/isemail-1.2.0.tgz#be03df8cc3e29de4d2c5df6501263f1fa4595e9a"
-isemail@2.x.x:
- version "2.2.1"
- resolved "https://registry.yarnpkg.com/isemail/-/isemail-2.2.1.tgz#0353d3d9a62951080c262c2aa0a42b8ea8e9e2a6"
+isemail@3.x.x:
+ version "3.1.1"
+ resolved "https://registry.yarnpkg.com/isemail/-/isemail-3.1.1.tgz#e8450fe78ff1b48347db599122adcd0668bd92b5"
+ dependencies:
+ punycode "2.x.x"
isexe@^2.0.0:
version "2.0.0"
@@ -4696,10 +4702,6 @@ istanbul-reports@^1.1.2:
dependencies:
handlebars "^4.0.3"
-items@2.x.x:
- version "2.1.1"
- resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198"
-
iterall@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.0.2.tgz#41a2e96ce9eda5e61c767ee5dc312373bb046e91"
@@ -4933,14 +4935,13 @@ jest@^21.2.1:
dependencies:
jest-cli "^21.2.1"
-joi@^10.6.0:
- version "10.6.0"
- resolved "https://registry.yarnpkg.com/joi/-/joi-10.6.0.tgz#52587f02d52b8b75cdb0c74f0b164a191a0e1fc2"
+joi@^13.0.0:
+ version "13.1.2"
+ resolved "https://registry.yarnpkg.com/joi/-/joi-13.1.2.tgz#b2db260323cc7f919fafa51e09e2275bd089a97e"
dependencies:
- hoek "4.x.x"
- isemail "2.x.x"
- items "2.x.x"
- topo "2.x.x"
+ hoek "5.x.x"
+ isemail "3.x.x"
+ topo "3.x.x"
joi@^6.10.1:
version "6.10.1"
@@ -5109,7 +5110,7 @@ jsonpointer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
-jsonwebtoken@^7.0.0, jsonwebtoken@^7.4.3:
+jsonwebtoken@^7.0.0:
version "7.4.3"
resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-7.4.3.tgz#77f5021de058b605a1783fa1283e99812e645638"
dependencies:
@@ -5119,6 +5120,21 @@ jsonwebtoken@^7.0.0, jsonwebtoken@^7.4.3:
ms "^2.0.0"
xtend "^4.0.1"
+jsonwebtoken@^8.0.0:
+ version "8.1.1"
+ resolved "https://registry.yarnpkg.com/jsonwebtoken/-/jsonwebtoken-8.1.1.tgz#b04d8bb2ad847bc93238c3c92170ffdbdd1cb2ea"
+ dependencies:
+ jws "^3.1.4"
+ lodash.includes "^4.3.0"
+ lodash.isboolean "^3.0.3"
+ lodash.isinteger "^4.0.4"
+ lodash.isnumber "^3.0.3"
+ lodash.isplainobject "^4.0.6"
+ lodash.isstring "^4.0.1"
+ lodash.once "^4.0.0"
+ ms "^2.1.1"
+ xtend "^4.0.1"
+
jsprim@^1.2.2:
version "1.4.1"
resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2"
@@ -5463,6 +5479,10 @@ lodash.get@4.4.2, lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
+lodash.includes@^4.3.0:
+ version "4.3.0"
+ resolved "https://registry.yarnpkg.com/lodash.includes/-/lodash.includes-4.3.0.tgz#60bb98a87cb923c68ca1e51325483314849f553f"
+
lodash.isarguments@^3.0.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
@@ -5471,6 +5491,10 @@ lodash.isarray@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55"
+lodash.isboolean@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6"
+
lodash.isempty@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e"
@@ -5479,11 +5503,19 @@ lodash.isequal@^4.4.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+lodash.isinteger@^4.0.4:
+ version "4.0.4"
+ resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343"
+
+lodash.isnumber@^3.0.3:
+ version "3.0.3"
+ resolved "https://registry.yarnpkg.com/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz#3ce76810c5928d03352301ac287317f11c0b1ffc"
+
lodash.isobject@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/lodash.isobject/-/lodash.isobject-3.0.2.tgz#3c8fb8d5b5bf4bf90ae06e14f2a530a4ed935e1d"
-lodash.isplainobject@^4.0.0:
+lodash.isplainobject@^4.0.0, lodash.isplainobject@^4.0.6:
version "4.0.6"
resolved "https://registry.yarnpkg.com/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz#7c526a52d89b45c45cc690b88163be0497f550cb"
@@ -5977,7 +6009,7 @@ ms@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
-ms@^2.0.0:
+ms@^2.0.0, ms@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a"
@@ -7507,6 +7539,10 @@ punycode@1.4.1, punycode@^1.2.4, punycode@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e"
+punycode@2.x.x:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
+
pym.js@^1.3.2:
version "1.3.2"
resolved "https://registry.yarnpkg.com/pym.js/-/pym.js-1.3.2.tgz#0ebd083c5a7ef7650214db872b4b29a10743305d"
@@ -9100,11 +9136,11 @@ topo@1.x.x:
dependencies:
hoek "2.x.x"
-topo@2.x.x:
- version "2.0.2"
- resolved "https://registry.yarnpkg.com/topo/-/topo-2.0.2.tgz#cd5615752539057c0dc0491a621c3bc6fbe1d182"
+topo@3.x.x:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/topo/-/topo-3.0.0.tgz#37e48c330efeac784538e0acd3e62ca5e231fe7a"
dependencies:
- hoek "4.x.x"
+ hoek "5.x.x"
touch@^3.1.0:
version "3.1.0"