diff options
| -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) { |
