diff options
| author | Adam Soltys <[email protected]> | 2025-02-28 14:36:49 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2025-02-28 14:36:49 -0800 |
| commit | 1b83f8398d34994b62c88fada6dba6a183227cbe (patch) | |
| tree | 9a6cf59a58f1f89fe3a81d57f897b68a9fe0bc46 | |
| parent | d168428c44cc4877d0b4876ece18272173b8f95c (diff) | |
| download | coinos-server-1b83f8398d34994b62c88fada6dba6a183227cbe.tar.gz coinos-server-1b83f8398d34994b62c88fada6dba6a183227cbe.zip | |
handle nprofiles
| -rw-r--r-- | routes/users.ts | 7 |
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) { |
