a lot of renames
This commit is contained in:
parent
966fde1111
commit
619503e799
9 changed files with 80 additions and 73 deletions
|
|
@ -3,7 +3,7 @@ const { getPublicKey, verifyEvent } = require("nostr-tools");
|
|||
const crypto = require("crypto");
|
||||
|
||||
const appInviteService = require('../services/appInviteService');
|
||||
const PublicKeyInvitedService = require('../services/PublicKeyInvitedService');
|
||||
const PublicKeySignedUpService = require('../services/PublicKeySignedUpService');
|
||||
const sessionService = require('../services/sessionService');
|
||||
const nostrService = require('../services/nostrService');
|
||||
|
||||
|
|
@ -37,9 +37,9 @@ router.post('/session-npubbed', async (req, res) => {
|
|||
});
|
||||
|
||||
|
||||
router.post('/invited-npub', async (req, res) => {
|
||||
router.post('/sign-public-key-up', async (req, res) => {
|
||||
const inviteUuid = req.cookies.inviteUuid;
|
||||
const npub = req.body.npub;
|
||||
const publicKey = req.body.publicKey;
|
||||
|
||||
if (await !appInviteService.appInviteExists(inviteUuid)) {
|
||||
return res.status(404).render('error', { message: 'Invite not found' });
|
||||
|
|
@ -49,12 +49,12 @@ router.post('/invited-npub', async (req, res) => {
|
|||
return res.status(410).json({ error: 'Invite has already been used.' });
|
||||
}
|
||||
|
||||
await PublicKeyInvitedService.createPublicKeyInvite(
|
||||
await PublicKeySignedUpService.signUpPublicKey(
|
||||
inviteUuid,
|
||||
npub
|
||||
publicKey
|
||||
);
|
||||
|
||||
return res.json({ message: "Invited npub successfully." })
|
||||
return res.json({ message: "Invited public key successfully." })
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ router.post("/nostr-verify", async (req, res) => {
|
|||
return res.status(400).json({ success: false, error: "Invalid signature" });
|
||||
}
|
||||
|
||||
if (!PublicKeyInvitedService.isPublicKeyInvited(signedEvent.pubkey)) {
|
||||
if (!PublicKeySignedUpService.isPublicKeyInvited(signedEvent.pubkey)) {
|
||||
return res.status(400).json(
|
||||
{
|
||||
success: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue