From ae031635cc911bc3e02eacd40bfb95446aefe793 Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 13 Jan 2023 13:37:07 +0000 Subject: [PATCH 1/2] Enable snort nip5 service --- src/pages/Verification.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pages/Verification.tsx b/src/pages/Verification.tsx index 4d21cacaa..27a946c9d 100644 --- a/src/pages/Verification.tsx +++ b/src/pages/Verification.tsx @@ -4,12 +4,13 @@ import './Verification.css' export default function VerificationPage() { const services = [ - /*{ + { name: "Snort", service: "https://api.snort.social/api/v1/n5sp", link: "https://snort.social/", + supportLink: "https://snort.social/help", about: <>Our very own NIP-05 verification service, help support the development of this site and get a shiny special badge on our site! - },*/ + }, { name: "Nostr Plebs", service: "https://nostrplebs.com/api/v1", From 6b34372b8d691e9a654b81b5dd9c07df71df838e Mon Sep 17 00:00:00 2001 From: Kieran Date: Fri, 13 Jan 2023 14:28:27 +0000 Subject: [PATCH 2/2] Cleanup error flow --- src/element/Nip5Service.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/element/Nip5Service.tsx b/src/element/Nip5Service.tsx index b3b2c9950..1612346ba 100644 --- a/src/element/Nip5Service.tsx +++ b/src/element/Nip5Service.tsx @@ -68,10 +68,17 @@ export default function Nip5Service(props: Nip05ServiceProps) { }, [props]); useEffect(() => { - if (handle.length === 0) { - setAvailabilityResponse(undefined); - } + setError(undefined); + setAvailabilityResponse(undefined); if (handle && domain) { + if(handle.length < (domainConfig?.length[0] ?? 2)) { + setAvailabilityResponse({ available: false, why: "TOO_SHORT" }); + return; + } + if(handle.length > (domainConfig?.length[1] ?? 20)) { + setAvailabilityResponse({ available: false, why: "TOO_LONG" }); + return; + } let rx = new RegExp(domainConfig?.regex[0] ?? "", domainConfig?.regex[1] ?? ""); if (!rx.test(handle)) { setAvailabilityResponse({ available: false, why: "REGEX" });