From 5cbae842e09eb239c886cdf859dbd9569ff36748 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Mon, 23 Feb 2026 19:43:34 -0600 Subject: [PATCH] Fix /domain.com routes 404ing for _@domain.com NIP-05 users isNip05Like in NIP19Page only checked for '@', so bare domain identifiers like 'fiatjaf.com' fell through to NIP-19 decoding and returned NotFound. Extend the check to match the same dot-based heuristic already used in ProfilePage. --- src/pages/NIP19Page.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/pages/NIP19Page.tsx b/src/pages/NIP19Page.tsx index a4ec483e..c029217c 100644 --- a/src/pages/NIP19Page.tsx +++ b/src/pages/NIP19Page.tsx @@ -10,10 +10,15 @@ import type { AddressPointer } from 'nostr-tools/nip19'; const HEX_64_RE = /^[0-9a-f]{64}$/; /** - * Returns true if the identifier looks like a NIP-05 username (contains @). + * Returns true if the identifier looks like a NIP-05 identifier. + * Covers both `user@domain.com` and bare domains like `fiatjaf.com` + * (which represent `_@domain.com` root users). */ function isNip05Like(id: string): boolean { - return id.includes('@'); + if (id.includes('@')) return true; + // Bare domain (e.g. "fiatjaf.com") — has a dot but is not a NIP-19 bech32 prefix + if (id.includes('.') && !id.startsWith('npub1') && !id.startsWith('nprofile1')) return true; + return false; } /**