aboutsummaryrefslogtreecommitdiffstats
path: root/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-10-01 07:21:14 -0700
committerAdam Soltys <[email protected]>2025-10-01 07:21:14 -0700
commitdf471202a97f8469725c825868677251ed0c34f5 (patch)
tree0c6e981c708f6293420bc95782cccd4c858d49de /routes
parent5061e32b32d26c55fe854f9c1635e827449b2871 (diff)
downloadcoinos-server-df471202a97f8469725c825868677251ed0c34f5.tar.gz
coinos-server-df471202a97f8469725c825868677251ed0c34f5.zip
login challenge
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;