From 1b83f8398d34994b62c88fada6dba6a183227cbe Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 28 Feb 2025 14:36:49 -0800 Subject: handle nprofiles --- routes/users.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/routes/users.ts b/routes/users.ts index 30c492dd..168bf550 100644 --- a/routes/users.ts +++ b/routes/users.ts @@ -20,6 +20,7 @@ import { authenticator } from "otplib"; import { v4 } from "uuid"; import { PaymentType } from "$lib/types"; +import type { ProfilePointer } from "nostr-tools/nip19"; export default { upload, @@ -86,6 +87,12 @@ export default { } catch (e) {} } + if (key.startsWith("nprofile")) { + try { + ({ pubkey: key } = nip19.decode(key).data as ProfilePointer); + } catch (e) {} + } + const user = await getNostrUser(key); res.send(pick(user, fields)); } catch (e) { -- cgit v1.2.3