aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-02-28 14:36:49 -0800
committerAdam Soltys <[email protected]>2025-02-28 14:36:49 -0800
commit1b83f8398d34994b62c88fada6dba6a183227cbe (patch)
tree9a6cf59a58f1f89fe3a81d57f897b68a9fe0bc46
parentd168428c44cc4877d0b4876ece18272173b8f95c (diff)
downloadcoinos-server-1b83f8398d34994b62c88fada6dba6a183227cbe.tar.gz
coinos-server-1b83f8398d34994b62c88fada6dba6a183227cbe.zip
handle nprofiles
-rw-r--r--routes/users.ts7
1 files changed, 7 insertions, 0 deletions
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) {