summaryrefslogtreecommitdiff
path: root/lib/models
diff options
context:
space:
mode:
authorClaudius Coenen2018-11-14 14:10:14 +0100
committerClaudius Coenen2018-11-14 23:15:36 +0100
commit858a59529e4b99d5c13e6fce8354cd9e9b00a462 (patch)
tree08e51914a7d6dd00c993c3b7f2481521a1ba6f0e /lib/models
parentf9aa001ee78e604415c2a6e82f65701a1f07d3c4 (diff)
switching to eslint for code checking
most rules degraded to WARN, so we don't go insane. This will change over time. The aim is to conform to a common style Signed-off-by: Claudius Coenen <opensource@amenthes.de>
Diffstat (limited to '')
-rw-r--r--lib/models/index.js1
-rw-r--r--lib/models/user.js2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/models/index.js b/lib/models/index.js
index 0a44ca87..ef70475e 100644
--- a/lib/models/index.js
+++ b/lib/models/index.js
@@ -25,6 +25,7 @@ if (config.dbURL) {
// https://github.com/sequelize/sequelize/issues/6485
function stripNullByte (value) {
value = '' + value
+ // eslint-disable-next-line no-control-regex
return value ? value.replace(/\u0000/g, '') : value
}
sequelize.stripNullByte = stripNullByte
diff --git a/lib/models/user.js b/lib/models/user.js
index 1bd8c745..2ebf6d06 100644
--- a/lib/models/user.js
+++ b/lib/models/user.js
@@ -50,7 +50,7 @@ module.exports = function (sequelize, DataTypes) {
}, {
instanceMethods: {
verifyPassword: function (attempt) {
- if (scrypt.verifyKdfSync(new Buffer(this.password, 'hex'), attempt)) {
+ if (scrypt.verifyKdfSync(Buffer.from(this.password, 'hex'), attempt)) {
return this
} else {
return false