diff --git a/src/pages/create/index.tsx b/src/pages/create/index.tsx index dfe3338..1defde7 100644 --- a/src/pages/create/index.tsx +++ b/src/pages/create/index.tsx @@ -251,10 +251,15 @@ export const CreatePage = () => { } else { // Otherwize if search already provided some results, user must manually click the search button if (!foundUsers.length) { - // If it's NIP05 send request to .well-known - if (userSearchInput.includes('@')) { + // If it's NIP05 (includes @ or is a valid domain) send request to .well-known + const domainRegex = /^[a-zA-Z0-9@.-]+\.[a-zA-Z]{2,}$/ + if (domainRegex.test(userSearchInput)) { + setSearchUsersLoading(true) + const pubkey = await handleSearchUserNip05(userSearchInput) + setSearchUsersLoading(false) + if (pubkey) { setUserInput(userSearchInput) } else {