diff options
| author | Adam Soltys <[email protected]> | 2023-02-06 23:20:08 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-06 23:20:19 -0800 |
| commit | 831877b74fdd62f96e1b385225b41e1415b13fba (patch) | |
| tree | a2f40f03f07af4d30d93a802a1c3417a6b95df21 | |
| parent | 61b2836e61ea120a8c808cda315a7eaa53e567fa (diff) | |
| download | coinos-server-831877b74fdd62f96e1b385225b41e1415b13fba.tar.gz coinos-server-831877b74fdd62f96e1b385225b41e1415b13fba.zip | |
pin endpoint
| -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); |
