diff options
| -rw-r--r-- | index.js | 1 | ||||
| -rw-r--r-- | routes/users.js | 4 |
2 files changed, 5 insertions, 0 deletions
@@ -76,6 +76,7 @@ app.post("/logout", optional, users.logout); app.post("/subscribe", auth, users.subscribe); app.post("/password", auth, users.password); +app.post("/pin", auth, users.pin); app.post("/otpsecret", auth, users.otpsecret); app.get("/contacts", auth, users.contacts); diff --git a/routes/users.js b/routes/users.js index ea4026b8..615e9d41 100644 --- a/routes/users.js +++ b/routes/users.js @@ -347,6 +347,10 @@ export default { res.send(await bcrypt.compare(password, user.password)); }, + async pin({ body: { pin }, user }, res) { + res.send(!user.pin || user.pin === pin); + }, + async otpsecret(req, res) { try { await requirePin(req); |
