mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
fix naked pubkey test regex
This commit is contained in:
parent
2f9dd7e9a2
commit
00fe609ef1
1 changed files with 1 additions and 1 deletions
|
|
@ -98,7 +98,7 @@ function truncate(s: string, len: number, ellipsis = '…') {
|
|||
|
||||
export async function getHandle(id: string, name?: string | undefined) {
|
||||
console.debug({ id, name });
|
||||
const pubkey = /[a-z][0-9]{64}/.test(id) ? id : await lookupPubkey(id);
|
||||
const pubkey = /[a-z0-9]{64}/.test(id) ? id : await lookupPubkey(id);
|
||||
if (!pubkey) throw new Error('Invalid user identifier');
|
||||
const parsed = await parseAndVerifyNip05(id, pubkey);
|
||||
return parsed?.handle || name || 'npub1xxx';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue