merge services
This commit is contained in:
parent
2b6853bf11
commit
ea91107347
4 changed files with 37 additions and 43 deletions
|
|
@ -3,7 +3,6 @@ const { getPublicKey, verifyEvent } = require("nostr-tools");
|
|||
const crypto = require("crypto");
|
||||
|
||||
const invitesService = require('../services/invitesService');
|
||||
const PublicKeySignedUpService = require('../services/PublicKeySignedUpService');
|
||||
const sessionService = require('../services/sessionService');
|
||||
const nostrService = require('../services/nostrService');
|
||||
|
||||
|
|
@ -41,7 +40,7 @@ router.post('/sign-public-key-up', async (req, res) => {
|
|||
const inviteUuid = req.cookies.inviteUuid;
|
||||
const publicKey = req.body.publicKey;
|
||||
|
||||
if (await !invitesService.appInviteExists(inviteUuid)) {
|
||||
if (await (!invitesService.appInviteExists(inviteUuid))) {
|
||||
return res.status(404).render('error', { message: 'Invite not found' });
|
||||
}
|
||||
|
||||
|
|
@ -49,7 +48,7 @@ router.post('/sign-public-key-up', async (req, res) => {
|
|||
return res.status(410).json({ error: 'Invite has already been used.' });
|
||||
}
|
||||
|
||||
await PublicKeySignedUpService.signUpPublicKey(
|
||||
await invitesService.signUpPublicKey(
|
||||
inviteUuid,
|
||||
publicKey
|
||||
);
|
||||
|
|
@ -92,7 +91,7 @@ router.post("/nostr-verify", async (req, res) => {
|
|||
return res.status(400).json({ success: false, error: "Invalid signature" });
|
||||
}
|
||||
|
||||
if (!PublicKeySignedUpService.isPublicKeyInvited(signedEvent.pubkey)) {
|
||||
if (!invitesService.isPublicKeyInvited(signedEvent.pubkey)) {
|
||||
return res.status(400).json(
|
||||
{
|
||||
success: false,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue