nostr challenge creation works

This commit is contained in:
counterweight 2025-02-11 18:15:06 +01:00
parent 7e4adf052c
commit 9ed583ecdb
Signed by: counterweight
GPG key ID: 883EDBAA726BD96C
5 changed files with 103 additions and 14 deletions

View file

@ -1,8 +1,11 @@
const express = require('express');
//const { generatePrivateKey, getPublicKey, verifySignature } = require("nostr-tools");
const crypto = require("crypto");
const appInviteService = require('../services/appInviteService');
const invitedNpubService = require('../services/invitedNpubService');
const sessionService = require('../services/sessionService');
const nostrService = require('../services/nostrService');
const router = express.Router();
@ -55,4 +58,10 @@ router.post('/invited-npub', async (req, res) => {
});
router.get('/nostr-challenge', async (req, res) => {
const nostrChallenge = await nostrService.createNostrChallenge();
res.json({ 'challenge': nostrChallenge.challenge });
});
module.exports = router;