mirror of
https://github.com/aljazceru/landscape-template.git
synced 2025-12-29 12:04:23 +01:00
fix: update lightning address validation
handle 404 responses in lightning addresses validation closes issue #70
This commit is contained in:
@@ -30,9 +30,10 @@ const schema: yup.SchemaOf<IFormInputs> = yup.object({
|
||||
if (value) {
|
||||
const [name, domain] = value.split("@");
|
||||
const lnurl = `https://${domain}/.well-known/lnurlp/${name}`;
|
||||
await fetch(lnurl);
|
||||
const res = await fetch(lnurl);
|
||||
if (res.status === 200) return true;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
@@ -141,7 +142,7 @@ export default function UpdateAboutForm({ data, onClose }: Props) {
|
||||
|
||||
type='text'
|
||||
className="input-text"
|
||||
placeholder="UK, London"
|
||||
placeholder="Back-end Developer"
|
||||
{...register("jobTitle")}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user