aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--routes/users.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/routes/users.js b/routes/users.js
index 75bff8b5..af9a036d 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -356,9 +356,9 @@ export default {
payments.reverse().map(async (id) => await g(`payment:${id}`))
)
).filter((p) => p.type === types.internal && p.ref)) {
- if (!~contacts.findIndex(({ id }) => id === ref)) {
- contacts.unshift(await g(`user:${ref}`));
- }
+ let i = contacts.findIndex(({ id }) => id === ref)
+ if (~i) contacts.splice(i, 1);
+ contacts.unshift(await g(`user:${ref}`));
}
await s(`${id}:contacts`, contacts);
@@ -409,6 +409,11 @@ export default {
}
},
+ async printerlogin({ body: { username, topic } }, res) {
+ if (username === topic) res.send({ ok: true });
+ else bail(res, "unauthorized");
+ },
+
async acl({ body: { username, topic } }, res) {
if (username === topic) res.send({ ok: true });
else bail(res, "unauthorized");