aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/models/users.js10
-rw-r--r--routes/users.js3
2 files changed, 6 insertions, 7 deletions
diff --git a/db/models/users.js b/db/models/users.js
index 23dab0bf..72680fd8 100644
--- a/db/models/users.js
+++ b/db/models/users.js
@@ -1,5 +1,5 @@
import db from "$db/db";
-import { DataTypes } from '@sequelize/core';
+import { DataTypes } from "@sequelize/core";
const attributes = {
id: {
@@ -140,7 +140,7 @@ const attributes = {
unit: {
type: DataTypes.STRING(255),
allowNull: true,
- defaultValue: 'SAT',
+ defaultValue: "SAT",
primaryKey: false,
autoIncrement: false,
comment: null,
@@ -225,13 +225,13 @@ const attributes = {
field: "twofa"
},
cipher: {
- type: DataTypes.STRING(255),
+ type: DataTypes.STRING(255)
},
pubkey: {
- type: DataTypes.STRING(255),
+ type: DataTypes.STRING(255)
},
salt: {
- type: DataTypes.STRING(255),
+ type: DataTypes.STRING(255)
},
pin: {
type: DataTypes.STRING(255),
diff --git a/routes/users.js b/routes/users.js
index 20b3bfee..d2cb1540 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -363,8 +363,7 @@ let login = async (req, res) => {
if (
!user ||
- (user.password &&
- !(await bcrypt.compare(password, user.password)))
+ (user.password && !(await bcrypt.compare(password, user.password)))
) {
warn("invalid username or password attempt", username);
return res.code(401).send({});