aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
Diffstat (limited to 'routes')
-rw-r--r--routes/users.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/routes/users.ts b/routes/users.ts
index e3810d70..bca6e009 100644
--- a/routes/users.ts
+++ b/routes/users.ts
@@ -373,6 +373,17 @@ export default {
res.send({ challenge: id });
},
+ async challengeVerify(req, res) {
+ try {
+ const { challenge: id } = req.body;
+ const verified = await db.exists(`challenge:${id}`);
+ if (!verified) fail("Challenge not found");
+ res.send(verified);
+ } catch (e) {
+ bail(res, e.message);
+ }
+ },
+
async nostrAuth(req, res) {
try {
const { event, challenge, twofa } = req.body;