Verify NIP05's with cache, fixes #1

This commit is contained in:
Alex Gleason
2023-05-06 22:29:41 -05:00
parent f567acb58f
commit af9f376ad0
3 changed files with 90 additions and 12 deletions

View File

@@ -11,7 +11,7 @@ const credentialsController: AppController = async (c) => {
const event = await getAuthor(pubkey);
if (event) {
return c.json(toAccount(event, { withSource: true }));
return c.json(await toAccount(event, { withSource: true }));
}
return c.json({ error: 'Could not find user.' }, 404);
@@ -22,7 +22,7 @@ const accountController: AppController = async (c) => {
const event = await getAuthor(pubkey);
if (event) {
return c.json(toAccount(event));
return c.json(await toAccount(event));
}
return c.json({ error: 'Could not find user.' }, 404);
@@ -37,7 +37,7 @@ const accountLookupController: AppController = async (c) => {
const event = await lookupAccount(acct);
if (event) {
return c.json(toAccount(event));
return c.json(await toAccount(event));
}
return c.json({ error: 'Could not find user.' }, 404);
@@ -52,7 +52,7 @@ const accountSearchController: AppController = async (c) => {
const event = await lookupAccount(decodeURIComponent(q));
if (event) {
return c.json([toAccount(event)]);
return c.json([await toAccount(event)]);
}
return c.json([]);