aboutsummaryrefslogtreecommitdiffstats
path: root/routes/users.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-02-06 16:42:02 -0800
committerAdam Soltys <[email protected]>2023-02-06 16:42:02 -0800
commit6f5602d112b68adb7452abf3047f20c32e7725b6 (patch)
tree640903158751d97954cec7b8687f1aa88079305f /routes/users.js
parentf4c51cddc3d6c45fa1de5fd928b1b2a0f95774f8 (diff)
downloadcoinos-server-6f5602d112b68adb7452abf3047f20c32e7725b6.tar.gz
coinos-server-6f5602d112b68adb7452abf3047f20c32e7725b6.zip
auth middleware for disable2fa
Diffstat (limited to 'routes/users.js')
-rw-r--r--routes/users.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/routes/users.js b/routes/users.js
index 4fcc50df..17d4e1da 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -134,7 +134,7 @@ export default {
if (user.pin && !(pin === user.pin)) throw new Error("Pin required");
if (typeof newpin !== "undefined") user.pin = newpin;
- if (!user.pin) user.pin = null;
+ if (!user.pin || user.pin === "undefined") delete user.pin;
let exists;
if (username) exists = await g(`user:${username}`);
@@ -237,7 +237,7 @@ export default {
if (!p.with) continue;
let id = await g(`user:${p.with.username}`);
- let u = id && await g(`user:${id}`);
+ let u = id && (await g(`user:${id}`));
if (!u) {
u = await got(`${classic}/admin/migrate/${p.with.username}`, {